pub struct StructTypeInfo {
pub structure_type: StructureType,
pub fields: Vec<ParsedStructureField>,
pub index_by_name: HashMap<String, usize>,
pub encoding_ids: EncodingIds,
pub is_abstract: bool,
pub node_id: NodeId,
pub name: String,
}Expand description
Parsed info about a structure type.
Fields§
§structure_type: StructureTypeStructure variant. Structure, StructureWithOptionalFields, or Union.
fields: Vec<ParsedStructureField>List of structure fields. The order is significant.
index_by_name: HashMap<String, usize>Field index by name.
encoding_ids: EncodingIdsCollection of encoding IDs.
is_abstract: boolWhether this type is abstract and cannot be instantiated.
node_id: NodeIdStructure node ID.
name: StringStructure name.
Implementations§
Source§impl StructTypeInfo
impl StructTypeInfo
Sourcepub fn get_field(&self, idx: usize) -> Option<&ParsedStructureField>
pub fn get_field(&self, idx: usize) -> Option<&ParsedStructureField>
Get a field by index.
Sourcepub fn get_field_by_name(&self, idx: &str) -> Option<&ParsedStructureField>
pub fn get_field_by_name(&self, idx: &str) -> Option<&ParsedStructureField>
Get a field by name.
Sourcepub fn is_supported(&self) -> bool
pub fn is_supported(&self) -> bool
Return whether this struct is supported by the current version of the library. Types that are not supported will panic on encoding, and be skipped when decoding.
Currently this is only structures and unions with subtyped values.
Trait Implementations§
Source§impl Debug for StructTypeInfo
impl Debug for StructTypeInfo
Source§impl From<StructTypeInfo> for TypeInfo
impl From<StructTypeInfo> for TypeInfo
Source§fn from(value: StructTypeInfo) -> Self
fn from(value: StructTypeInfo) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for StructTypeInfo
impl RefUnwindSafe for StructTypeInfo
impl Send for StructTypeInfo
impl Sync for StructTypeInfo
impl Unpin for StructTypeInfo
impl UnsafeUnpin for StructTypeInfo
impl UnwindSafe for StructTypeInfo
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