pub struct TypeModifier<'input> { /* private fields */ }Expand description
A type that is obtained by adding a modifier to another type.
Implementations§
Source§impl<'input> TypeModifier<'input>
impl<'input> TypeModifier<'input>
Sourcepub fn name(&self) -> Option<&str>
pub fn name(&self) -> Option<&str>
The name of the type.
If this is None then the name should be derived from the type that is being modified.
Sourcepub fn kind(&self) -> TypeModifierKind
pub fn kind(&self) -> TypeModifierKind
The kind of this type modifier.
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 is being modified.
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(
hash_a: &FileHash<'_>,
a: &TypeModifier<'_>,
hash_b: &FileHash<'_>,
b: &TypeModifier<'_>,
) -> Ordering
pub fn cmp_id( hash_a: &FileHash<'_>, a: &TypeModifier<'_>, hash_b: &FileHash<'_>, b: &TypeModifier<'_>, ) -> Ordering
Compare the identifying information of two types.
Type modifiers are equal if the modifiers are the same and the types being modified are equal.
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§
Source§impl<'input> Clone for TypeModifier<'input>
impl<'input> Clone for TypeModifier<'input>
Source§fn clone(&self) -> TypeModifier<'input>
fn clone(&self) -> TypeModifier<'input>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<'input> Freeze for TypeModifier<'input>
impl<'input> RefUnwindSafe for TypeModifier<'input>
impl<'input> Send for TypeModifier<'input>
impl<'input> Sync for TypeModifier<'input>
impl<'input> Unpin for TypeModifier<'input>
impl<'input> UnwindSafe for TypeModifier<'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