pub struct Type<'input> { /* private fields */ }
Expand description
A type.
Implementations§
Source§impl<'input> Type<'input>
impl<'input> Type<'input>
Sourcepub fn from_offset<'a>(
hash: &'a FileHash<'input>,
offset: TypeOffset,
) -> Option<Cow<'a, Type<'input>>>
pub fn from_offset<'a>( hash: &'a FileHash<'input>, offset: TypeOffset, ) -> Option<Cow<'a, Type<'input>>>
Lookup a type given its offset.
Returns None
if the type offset is invalid.
Sourcepub fn offset(&self) -> TypeOffset
pub fn offset(&self) -> TypeOffset
The debuginfo offset of this type.
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 is_anon(&self) -> bool
pub fn is_anon(&self) -> bool
Return true if this is an anonymous type, or defined within an anonymous type.
Sourcepub fn cmp_id(
hash_a: &FileHash<'_>,
type_a: &Type<'_>,
hash_b: &FileHash<'_>,
type_b: &Type<'_>,
) -> Ordering
pub fn cmp_id( hash_a: &FileHash<'_>, type_a: &Type<'_>, hash_b: &FileHash<'_>, type_b: &Type<'_>, ) -> Ordering
Compare the identifying information of two types.
Equal types must have the same type kind. Further requirements for equality depend on the specific type kind.
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 Type<'input>
impl<'input> RefUnwindSafe for Type<'input>
impl<'input> Send for Type<'input>
impl<'input> Sync for Type<'input>
impl<'input> Unpin for Type<'input>
impl<'input> UnwindSafe for Type<'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