pub struct StructReader<'b, 'r> { /* private fields */ }Implementations§
Source§impl<'b, 'r> StructReader<'b, 'r>
impl<'b, 'r> StructReader<'b, 'r>
Sourcepub fn get(&self, id: u16) -> Result<Option<Ref<'b, 'r>>>
pub fn get(&self, id: u16) -> Result<Option<Ref<'b, 'r>>>
Read a field by its stable ID. Ok(None) means absent — either the
writer didn’t set it, or the writer’s schema doesn’t have it at all.
Sourcepub fn struct_def(&self) -> &'r StructDef
pub fn struct_def(&self) -> &'r StructDef
The reader-schema definition of this struct (field names for self-description).
Sourcepub fn get_str(&self, id: u16) -> Result<Option<&'b str>>
pub fn get_str(&self, id: u16) -> Result<Option<&'b str>>
Typed getter for string fields (borrows the buffer).
Sourcepub fn get_bytes(&self, id: u16) -> Result<Option<&'b [u8]>>
pub fn get_bytes(&self, id: u16) -> Result<Option<&'b [u8]>>
Typed getter for bytes fields (borrows the buffer).
Sourcepub fn get_enum(&self, id: u16) -> Result<Option<u32>>
pub fn get_enum(&self, id: u16) -> Result<Option<u32>>
Typed getter for enum fields (raw open value).
Sourcepub fn get_struct(&self, id: u16) -> Result<Option<StructReader<'b, 'r>>>
pub fn get_struct(&self, id: u16) -> Result<Option<StructReader<'b, 'r>>>
Typed getter for nested struct fields.
Sourcepub fn get_list(&self, id: u16) -> Result<Option<ListReader<'b, 'r>>>
pub fn get_list(&self, id: u16) -> Result<Option<ListReader<'b, 'r>>>
Typed getter for list fields.
Trait Implementations§
Source§impl<'b, 'r> Clone for StructReader<'b, 'r>
impl<'b, 'r> Clone for StructReader<'b, 'r>
Source§fn clone(&self) -> StructReader<'b, 'r>
fn clone(&self) -> StructReader<'b, 'r>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<'b, 'r> !RefUnwindSafe for StructReader<'b, 'r>
impl<'b, 'r> !Send for StructReader<'b, 'r>
impl<'b, 'r> !Sync for StructReader<'b, 'r>
impl<'b, 'r> !UnwindSafe for StructReader<'b, 'r>
impl<'b, 'r> Freeze for StructReader<'b, 'r>
impl<'b, 'r> Unpin for StructReader<'b, 'r>
impl<'b, 'r> UnsafeUnpin for StructReader<'b, 'r>
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