Struct capnp::schema::StructSchema
source · 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>
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
source§fn clone(&self) -> StructSchema
fn clone(&self) -> StructSchema
Returns a copy 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 moresource§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.
impl Copy for StructSchema
Auto Trait Implementations§
impl Freeze for StructSchema
impl !RefUnwindSafe for StructSchema
impl !Send for StructSchema
impl !Sync for StructSchema
impl Unpin for StructSchema
impl !UnwindSafe 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