Struct gluon_base::ast::AstType
source · pub struct AstType<'ast, Id> { /* private fields */ }
Implementations§
source§impl<'ast, Id> AstType<'ast, Id>
impl<'ast, Id> AstType<'ast, Id>
pub fn new( arena: ArenaRef<'_, 'ast, Id>, typ: Spanned<Type<Id, AstType<'ast, Id>>, BytePos> ) -> Self
pub fn new_no_loc( arena: ArenaRef<'_, 'ast, Id>, typ: Type<Id, AstType<'ast, Id>> ) -> Self
pub fn with_metadata<T>(
arena: ArenaRef<'_, 'ast, Id>,
metadata: T,
typ: Spanned<Type<Id, AstType<'ast, Id>>, BytePos>
) -> Selfwhere
T: Into<BaseMetadata<'ast>>,
pub fn set_metadata<T>(&mut self, metadata: T)where
T: Into<BaseMetadata<'ast>>,
pub fn remove_single_forall(&mut self) -> &mut AstType<'ast, Id>
pub fn span_mut(&mut self) -> &mut Span<BytePos>
Methods from Deref<Target = Type<Id, AstType<'ast, Id>>>§
pub fn as_variable(&self) -> Option<&TypeVariable>
pub fn is_array(&self) -> bool
pub fn as_function(&self) -> Option<(&T, &T)>
pub fn as_explicit_function(&self) -> Option<(&T, &T)>
pub fn as_function_with_type(&self) -> Option<(ArgType, &T, &T)>
pub fn unapplied_args(&self) -> Cow<'_, [T]>where
T: Clone,
pub fn alias_ident(&self) -> Option<&Id>
pub fn applied_alias(&self) -> Option<&AliasRef<Id, T>>
pub fn is_non_polymorphic_record(&self) -> bool
pub fn params(&self) -> &[Generic<Id>]
pub fn kind<'k>(&'k self, cache: &'k KindCache) -> Cow<'k, ArcKind>
sourcepub fn name(&self) -> Option<&SymbolRef>
pub fn name(&self) -> Option<&SymbolRef>
Returns the name of self
Example:
Option a => Option
Int => Int
pub fn owned_name(&self) -> Option<SymbolKey>
Trait Implementations§
source§impl<'ast, Id> AsMut<Spanned<Type<Id, AstType<'ast, Id>>, ByteIndex>> for AstType<'ast, Id>
impl<'ast, Id> AsMut<Spanned<Type<Id, AstType<'ast, Id>>, ByteIndex>> for AstType<'ast, Id>
source§fn as_mut(&mut self) -> &mut SpannedAstType<'ast, Id>
fn as_mut(&mut self) -> &mut SpannedAstType<'ast, Id>
Converts this type into a mutable reference of the (usually inferred) input type.
source§impl<'ast, Id> AstAlloc<'ast, Id> for AstType<'ast, Id>
impl<'ast, Id> AstAlloc<'ast, Id> for AstType<'ast, Id>
fn alloc(self, arena: &'ast Arena<'ast, Id>) -> &'ast mut Self
fn alloc_extend( iter: impl IntoIterator<Item = Self>, arena: &'ast Arena<'ast, Id> ) -> &'ast mut [Self]
source§impl<Id> HasMetadata for AstType<'_, Id>
impl<Id> HasMetadata for AstType<'_, Id>
source§impl<'ast, Id: PartialEq> PartialEq for AstType<'ast, Id>
impl<'ast, Id: PartialEq> PartialEq for AstType<'ast, Id>
source§impl<'ast, Id> TypeContext<Id, AstType<'ast, Id>> for ArenaRef<'_, 'ast, Id>
impl<'ast, Id> TypeContext<Id, AstType<'ast, Id>> for ArenaRef<'_, 'ast, Id>
fn intern(&mut self, typ: Type<Id, AstType<'ast, Id>>) -> AstType<'ast, Id>
fn intern_types( &mut self, types: impl IntoIterator<Item = AstType<'ast, Id>> ) -> &'ast mut [AstType<'ast, Id>]
fn intern_generics( &mut self, types: impl IntoIterator<Item = Generic<Id>> ) -> &'ast mut [Generic<Id>]
fn intern_fields( &mut self, types: impl IntoIterator<Item = Field<Spanned<Id, BytePos>, AstType<'ast, Id>>> ) -> &'ast mut [Field<Spanned<Id, BytePos>, AstType<'ast, Id>>]
fn intern_type_fields( &mut self, types: impl IntoIterator<Item = Field<Spanned<Id, BytePos>, Alias<Id, AstType<'ast, Id>>>> ) -> &'ast mut [Field<Spanned<Id, BytePos>, Alias<Id, AstType<'ast, Id>>>]
fn intern_flags( &mut self, typ: Type<Id, AstType<'ast, Id>>, _flags: Flags ) -> AstType<'ast, Id>
fn hole(&mut self) -> T
fn opaque(&mut self) -> T
fn error(&mut self) -> T
fn builtin(&mut self, typ: BuiltinType) -> T
fn forall(&mut self, params: T::Generics, typ: T) -> T
fn array(&mut self, typ: T) -> T
fn array_builtin(&mut self) -> T
fn app(&mut self, id: T, args: T::Types) -> T
fn variant(&mut self, fields: T::Fields) -> T
fn poly_variant(&mut self, fields: T::Fields, rest: T) -> T
fn effect(&mut self, fields: T::Fields) -> T
fn poly_effect(&mut self, fields: T::Fields, rest: T) -> T
fn record(&mut self, types: T::TypeFields, fields: T::Fields) -> T
fn poly_record(&mut self, types: T::TypeFields, fields: T::Fields, rest: T) -> T
fn extend_full_row( &mut self, types: T::TypeFields, fields: T::Fields, rest: T ) -> T
fn extend_row(&mut self, fields: T::Fields, rest: T) -> T
fn extend_type_row(&mut self, types: T::TypeFields, rest: T) -> T
fn empty_row(&mut self) -> T
fn function<I>(&mut self, args: I, ret: T) -> T
fn function_implicit<I>(&mut self, args: I, ret: T) -> T
fn function_type<I>(&mut self, arg_type: ArgType, args: I, ret: T) -> T
fn generic(&mut self, typ: Generic<Id>) -> T
fn skolem(&mut self, typ: Skolem<Id>) -> T
fn variable(&mut self, typ: TypeVariable) -> T
fn alias(&mut self, name: Id, args: T::Generics, typ: T) -> T
fn ident(&mut self, id: KindedIdent<Id>) -> T
fn projection(&mut self, id: AppVec<Id>) -> T
fn function_builtin(&mut self) -> T
fn string(&mut self) -> T
fn char(&mut self) -> T
fn byte(&mut self) -> T
fn int(&mut self) -> T
fn float(&mut self) -> T
fn unit(&mut self) -> T
fn builtin_type(&mut self, typ: BuiltinType) -> T
fn new_alias(&mut self, name: Id, args: T::Generics, typ: T) -> Alias<Id, T>
fn new_data_alias(&mut self, data: AliasData<Id, T>) -> Alias<Id, T>
source§impl<'ast, Id> TypePtr for AstType<'ast, Id>
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>>>]
fn flags(&self) -> Flags
fn spine(&self) -> &Self
impl<'ast, Id: Eq> Eq for AstType<'ast, Id>
impl<'ast, Id> RefUnwindSafe for AstType<'ast, Id>where
Id: RefUnwindSafe,
impl<'ast, Id> Send for AstType<'ast, Id>where
Id: Send,
impl<'ast, Id> StructuralEq for AstType<'ast, Id>
impl<'ast, Id> StructuralPartialEq for AstType<'ast, Id>
impl<'ast, Id> Sync for AstType<'ast, Id>where
Id: Sync,
Auto Trait Implementations§
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more