pub struct TypeDef<'input> { /* private fields */ }
Expand description
A type alias definition.
Implementations§
Source§impl<'input> TypeDef<'input>
impl<'input> TypeDef<'input>
Sourcepub fn ty<'a>(
&self,
hash: &'a FileHash<'input>,
) -> Option<Cow<'a, Type<'input>>>
pub fn ty<'a>( &self, hash: &'a FileHash<'input>, ) -> Option<Cow<'a, Type<'input>>>
The type that the alias is being defined for.
Sourcepub fn byte_size(&self, hash: &FileHash<'_>) -> Option<u64>
pub fn byte_size(&self, hash: &FileHash<'_>) -> Option<u64>
The size in bytes of an instance of this type.
Sourcepub fn cmp_id(a: &TypeDef<'_>, b: &TypeDef<'_>) -> Ordering
pub fn cmp_id(a: &TypeDef<'_>, b: &TypeDef<'_>) -> Ordering
Compare the identifying information of two types.
Type definitions are considered equal if their names are equal, even if the type being aliased is different.
This can be used to sort, and to determine if two types refer to the same definition (even if there are differences in the definitions).
Trait Implementations§
Auto Trait Implementations§
impl<'input> Freeze for TypeDef<'input>
impl<'input> RefUnwindSafe for TypeDef<'input>
impl<'input> Send for TypeDef<'input>
impl<'input> Sync for TypeDef<'input>
impl<'input> Unpin for TypeDef<'input>
impl<'input> UnwindSafe for TypeDef<'input>
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