Struct gluon_base::types::Alias
source · pub struct Alias<Id, T> { /* private fields */ }
Expand description
An alias is wrapper around Type::Alias
, allowing it to be cheaply converted to a type and
dereferenced to AliasRef
Implementations§
source§impl<Id, T> Alias<Id, T>where
T: TypePtr<Id = Id>,
impl<Id, T> Alias<Id, T>where T: TypePtr<Id = Id>,
pub fn new_with( context: &mut (impl TypeContext<Id, T> + ?Sized), name: Id, args: T::Generics, typ: T ) -> Self
source§impl<Id, T> Alias<Id, T>where
T: TypeExt<Id = Id> + From<Type<Id, T>>,
T::Types: Clone + Default + Extend<T>,
impl<Id, T> Alias<Id, T>where T: TypeExt<Id = Id> + From<Type<Id, T>>, T::Types: Clone + Default + Extend<T>,
source§impl<Id, T> Alias<Id, T>where
T: TypeExt<Id = Id> + Clone,
T::Types: Clone + Default + Extend<T>,
T::Generics: Clone,
T::Fields: Clone,
Id: Clone + PartialEq,
T::SpannedId: Clone + PartialEq,
impl<Id, T> Alias<Id, T>where T: TypeExt<Id = Id> + Clone, T::Types: Clone + Default + Extend<T>, T::Generics: Clone, T::Fields: Clone, Id: Clone + PartialEq, T::SpannedId: Clone + PartialEq,
sourcepub fn typ(&self, interner: &mut impl TypeContext<Id, T>) -> Cow<'_, T>
pub fn typ(&self, interner: &mut impl TypeContext<Id, T>) -> Cow<'_, T>
Returns the actual type of the alias
pub fn unpack_canonical_alias<'b>( &'b self, canonical_alias_type: &'b T, un_alias: impl FnMut(&'b AliasRef<Id, T>) -> Cow<'b, T> ) -> (Cow<'b, [Generic<Id>]>, &'b AliasRef<Id, T>, Cow<'b, T>)
Methods from Deref<Target = AliasRef<Id, T>>§
pub fn try_get_alias_mut(&mut self) -> Option<&mut AliasData<Id, T>>
pub fn typ(&self, interner: &mut impl TypeContext<Id, T>) -> Cow<'_, T>
Methods from Deref<Target = AliasData<Id, T>>§
sourcepub fn unresolved_type(&self) -> &T
pub fn unresolved_type(&self) -> &T
Returns the type aliased by self
with out Type::Ident
resolved to their actual
Type::Alias
representation
pub fn is_implicit(&self) -> bool
pub fn self_type(&self, context: &mut (impl TypeContext<Id, T> + ?Sized)) -> T
pub fn params(&self) -> &[Generic<Id>]
pub fn aliased_type(&self) -> &T
pub fn kind<'k>(&'k self, cache: &'k KindCache) -> Cow<'k, ArcKind>
Trait Implementations§
source§impl<'ast, Id, T> AstClone<'ast, Id> for Alias<Id, T>where
Id: AstClone<'ast, Id> + Clone,
T: AstClone<'ast, Id>,
impl<'ast, Id, T> AstClone<'ast, Id> for Alias<Id, T>where Id: AstClone<'ast, Id> + Clone, T: AstClone<'ast, Id>,
source§impl<Id, T> DerefMut for Alias<Id, T>where
T: TypePtr<Id = Id> + DerefMut<Target = Type<Id, T>>,
impl<Id, T> DerefMut for Alias<Id, T>where T: TypePtr<Id = Id> + DerefMut<Target = Type<Id, T>>,
source§impl<Id, T> From<AliasData<Id, T>> for Alias<Id, T>where
T: TypeExt<Id = Id> + From<Type<Id, T>>,
T::Types: Clone + Default + Extend<T>,
impl<Id, T> From<AliasData<Id, T>> for Alias<Id, T>where T: TypeExt<Id = Id> + From<Type<Id, T>>, T::Types: Clone + Default + Extend<T>,
source§impl<Id, T> From<AliasRef<Id, T>> for Alias<Id, T>where
T: TypePtr<Id = Id> + From<Type<Id, T>>,
impl<Id, T> From<AliasRef<Id, T>> for Alias<Id, T>where T: TypePtr<Id = Id> + From<Type<Id, T>>,
source§impl<Id: PartialEq, T: PartialEq> PartialEq<Alias<Id, T>> for Alias<Id, T>
impl<Id: PartialEq, T: PartialEq> PartialEq<Alias<Id, T>> for Alias<Id, T>
impl<Id: Eq, T: Eq> Eq for Alias<Id, T>
impl<Id, T> StructuralEq for Alias<Id, T>
impl<Id, T> StructuralPartialEq for Alias<Id, T>
Auto Trait Implementations§
impl<Id, T> RefUnwindSafe for Alias<Id, T>where Id: RefUnwindSafe, T: RefUnwindSafe,
impl<Id, T> Send for Alias<Id, T>where Id: Send, T: Send,
impl<Id, T> Sync for Alias<Id, T>where Id: Sync, T: Sync,
impl<Id, T> Unpin for Alias<Id, T>where Id: Unpin, T: Unpin,
impl<Id, T> UnwindSafe for Alias<Id, T>where Id: UnwindSafe, T: UnwindSafe,
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