pub struct StructSchema { /* private fields */ }Expand description
A struct node, with generics applied.
Implementations§
Source§impl StructSchema
impl StructSchema
pub fn new(raw: RawBrandedStructSchema) -> Self
pub fn get_proto(&self) -> Reader<'static>
Sourcepub fn get_newtype_ids(&self) -> &'static [u64]
pub fn get_newtype_ids(&self) -> &'static [u64]
For a group declared with a group or union type newtype, the ids
of that newtype and the newtypes it aliases, nearest first; the same
as the parent field’s Field::get_newtype_ids. Empty for any
other struct or group.
A group with ids.contains(&vec3::TYPE_ID) can be downcast to
vec3::AnyReader (or AnyBuilder).
pub fn get_fields(self) -> Result<FieldList>
pub fn get_field_by_discriminant( self, discriminant: u16, ) -> Result<Option<Field>>
Sourcepub fn find_field_by_name(&self, name: &str) -> Result<Option<Field>>
pub fn find_field_by_name(&self, name: &str) -> Result<Option<Field>>
Looks up a field by name using binary search. Returns None if no matching field is found.
Sourcepub fn get_field_by_name(&self, name: &str) -> Result<Field>
pub fn get_field_by_name(&self, name: &str) -> Result<Field>
Like find_field_by_name(), but returns an error if the field is not found.
pub fn get_union_fields(self) -> Result<FieldSubset>
pub fn get_non_union_fields(self) -> Result<FieldSubset>
pub fn get_annotations(self) -> Result<AnnotationList>
Trait Implementations§
Source§impl Clone for StructSchema
impl Clone for StructSchema
impl Copy for StructSchema
Source§impl Debug for StructSchema
impl Debug for StructSchema
impl Eq for StructSchema
Source§impl From<RawBrandedStructSchema> for StructSchema
impl From<RawBrandedStructSchema> for StructSchema
Source§fn from(rs: RawBrandedStructSchema) -> StructSchema
fn from(rs: RawBrandedStructSchema) -> StructSchema
Converts to this type from the input type.
Source§impl From<StructSchema> for RawBrandedStructSchema
impl From<StructSchema> for RawBrandedStructSchema
Source§fn from(value: StructSchema) -> Self
fn from(value: StructSchema) -> Self
Converts to this type from the input type.
Source§impl Hash for StructSchema
impl Hash for StructSchema
Auto Trait Implementations§
impl !RefUnwindSafe for StructSchema
impl !Send for StructSchema
impl !Sync for StructSchema
impl !UnwindSafe for StructSchema
impl Freeze for StructSchema
impl Unpin for StructSchema
impl UnsafeUnpin for StructSchema
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