[][src]Struct gluon_base::types::Alias

pub struct Alias<Id, T> { /* fields omitted */ }

An alias is wrapper around Type::Alias, allowing it to be cheaply converted to a type and dereferenced to AliasRef

Implementations

impl<Id, T> Alias<Id, T> where
    T: TypePtr<Id = Id>, 
[src]

pub fn new_with(
    context: &mut impl TypeContext<Id, T> + ?Sized,
    name: Id,
    args: T::Generics,
    typ: T
) -> Self
[src]

impl<Id, T> Alias<Id, T> where
    T: TypeExt<Id = Id> + From<Type<Id, T>>,
    T::Types: Clone + Default + Extend<T>, 
[src]

pub fn new(name: Id, args: T::Generics, typ: T) -> Alias<Id, T>[src]

pub fn group(group: Vec<AliasData<Id, T>>) -> Vec<Alias<Id, T>>[src]

impl<Id, T> Alias<Id, T>[src]

pub fn as_type(&self) -> &T[src]

pub fn into_type(self) -> T[src]

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
[src]

pub fn typ(&self, interner: &mut impl TypeContext<Id, T>) -> Cow<'_, T>[src]

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>)
[src]

Methods from Deref<Target = AliasRef<Id, T>>

pub fn try_get_alias_mut(&mut self) -> Option<&mut AliasData<Id, T>>[src]

pub fn typ(&self, interner: &mut impl TypeContext<Id, T>) -> Cow<'_, T>[src]

Trait Implementations

impl<Id, T> AsRef<T> for Alias<Id, T>[src]

impl<'ast, Id, T> AstClone<'ast, Id> for Alias<Id, T> where
    Id: AstClone<'ast, Id>,
    T: AstClone<'ast, Id>,
    Id: Clone
[src]

impl<Id: Clone, T: Clone> Clone for Alias<Id, T>[src]

impl<Id: Debug, T: Debug> Debug for Alias<Id, T>[src]

impl<Id, T> Deref for Alias<Id, T> where
    T: TypePtr<Id = Id>, 
[src]

type Target = AliasRef<Id, T>

The resulting type after dereferencing.

impl<Id, T> DerefMut for Alias<Id, T> where
    T: TypePtr<Id = Id> + DerefMut<Target = Type<Id, T>>, 
[src]

impl<Id: Eq, T: Eq> Eq for Alias<Id, T>[src]

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>, 
[src]

impl<Id, T> From<AliasRef<Id, T>> for Alias<Id, T> where
    T: TypePtr<Id = Id> + From<Type<Id, T>>, 
[src]

impl<Id: Hash, T: Hash> Hash for Alias<Id, T>[src]

impl<Id: PartialEq, T: PartialEq> PartialEq<Alias<Id, T>> for Alias<Id, T>[src]

impl<Id, T> StructuralEq for Alias<Id, T>[src]

impl<Id, T> StructuralPartialEq for Alias<Id, T>[src]

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<Id> AsId<Id> for Id where
    Id: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.