pub struct TypesView<'a> { /* private fields */ }Expand description
View into type metadata.
Types are stored in three sub-sections:
- TypeDefs: structural topology (4 bytes each)
- TypeMembers: fields and variants (4 bytes each)
- TypeNames: name → TypeId mapping (4 bytes each)
Implementations§
Source§impl<'a> TypesView<'a>
impl<'a> TypesView<'a>
Sourcepub fn get_member(&self, idx: usize) -> TypeMember
pub fn get_member(&self, idx: usize) -> TypeMember
Get a type member by index.
Sourcepub fn defs_count(&self) -> usize
pub fn defs_count(&self) -> usize
Number of type definitions.
Sourcepub fn members_count(&self) -> usize
pub fn members_count(&self) -> usize
Number of type members.
Sourcepub fn names_count(&self) -> usize
pub fn names_count(&self) -> usize
Number of type names.
Sourcepub fn members_of(&self, def: &TypeDef) -> impl Iterator<Item = TypeMember> + '_
pub fn members_of(&self, def: &TypeDef) -> impl Iterator<Item = TypeMember> + '_
Iterate over members of a struct or enum type.
Sourcepub fn unwrap_optional(&self, type_id: TypeId) -> (TypeId, bool)
pub fn unwrap_optional(&self, type_id: TypeId) -> (TypeId, bool)
Unwrap Optional wrapper and return (inner_type, is_optional). If not Optional, returns (type_id, false).
Auto Trait Implementations§
impl<'a> Freeze for TypesView<'a>
impl<'a> RefUnwindSafe for TypesView<'a>
impl<'a> Send for TypesView<'a>
impl<'a> Sync for TypesView<'a>
impl<'a> Unpin for TypesView<'a>
impl<'a> UnwindSafe for TypesView<'a>
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