Trait gluon_base::types::TypePtr

source ·
pub trait TypePtr: Deref<Target = Type<Self::Id, Self>> + Sized {
    type Id;
    type SpannedId;
    type Types: TypeAlloc<Self> + Deref<Target = [Self]> + Default;
    type Generics: TypeAlloc<Self> + Deref<Target = [Generic<Self::Id>]> + Default;
    type Fields: TypeAlloc<Self> + Deref<Target = [Field<Self::SpannedId, Self>]> + Default;
    type TypeFields: TypeAlloc<Self> + Deref<Target = [Field<Self::SpannedId, Alias<Self::Id, Self>>]> + Default;

    // Provided methods
    fn flags(&self) -> Flags { ... }
    fn spine(&self) -> &Self { ... }
    fn display<A>(&self, width: usize) -> TypeFormatter<'_, Self::Id, Self, A>
       where Self::Id: AsRef<str>,
             Self::SpannedId: AsRef<str> { ... }
}

Required Associated Types§

source

type Id

source

type SpannedId

source

type Types: TypeAlloc<Self> + Deref<Target = [Self]> + Default

source

type Generics: TypeAlloc<Self> + Deref<Target = [Generic<Self::Id>]> + Default

source

type Fields: TypeAlloc<Self> + Deref<Target = [Field<Self::SpannedId, Self>]> + Default

source

type TypeFields: TypeAlloc<Self> + Deref<Target = [Field<Self::SpannedId, Alias<Self::Id, Self>>]> + Default

Provided Methods§

source

fn flags(&self) -> Flags

source

fn spine(&self) -> &Self

source

fn display<A>(&self, width: usize) -> TypeFormatter<'_, Self::Id, Self, A>
where Self::Id: AsRef<str>, Self::SpannedId: AsRef<str>,

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<'ast, Id> TypePtr for AstType<'ast, Id>

§

type Id = Id

§

type SpannedId = Spanned<Id, ByteIndex>

§

type Types = &'ast mut [AstType<'ast, Id>]

§

type Generics = &'ast mut [Generic<Id>]

§

type Fields = &'ast mut [Field<<AstType<'ast, Id> as TypePtr>::SpannedId, AstType<'ast, Id>>]

§

type TypeFields = &'ast mut [Field<<AstType<'ast, Id> as TypePtr>::SpannedId, Alias<Id, AstType<'ast, Id>>>]

source§

impl<Id> TypePtr for ArcType<Id>

§

type Id = Id

§

type SpannedId = Id

§

type Types = SmallVec<[ArcType<Id>; 2]>

§

type Generics = Vec<Generic<Id>>

§

type Fields = Vec<Field<Id>>

§

type TypeFields = Vec<Field<Id, Alias<Id, ArcType<Id>>>>