Struct capnp::dynamic_struct::Reader
source · pub struct Reader<'a> { /* private fields */ }
Expand description
A read-only dynamically-typed struct.
Implementations§
source§impl<'a> Reader<'a>
impl<'a> Reader<'a>
pub fn new(reader: StructReader<'a>, schema: StructSchema) -> Self
pub fn total_size(&self) -> Result<MessageSize>
pub fn get_schema(&self) -> StructSchema
pub fn get(self, field: Field) -> Result<Reader<'a>>
sourcepub fn get_named(self, field_name: &str) -> Result<Reader<'a>>
pub fn get_named(self, field_name: &str) -> Result<Reader<'a>>
Gets the field with the given name.
sourcepub fn which(&self) -> Result<Option<Field>>
pub fn which(&self) -> Result<Option<Field>>
If this struct has union fields, returns the one that is currently active. Otherwise, returns None.
sourcepub fn has(&self, field: Field) -> Result<bool>
pub fn has(&self, field: Field) -> Result<bool>
On a field that is part of a union, returns true
if the field
is active in the union and is not a null pointer. On non-union fields,
returns true
if the field is not a null pointer.
pub fn has_named(&self, field_name: &str) -> Result<bool>
Trait Implementations§
source§impl<'a> DowncastReader<'a> for Reader<'a>
impl<'a> DowncastReader<'a> for Reader<'a>
fn downcast_reader(value: Reader<'a>) -> Self
source§impl<'a> SetterInput<Owned> for Reader<'a>
impl<'a> SetterInput<Owned> for Reader<'a>
source§fn set_pointer_builder<'b>(
pointer: PointerBuilder<'b>,
value: Reader<'a>,
canonicalize: bool
) -> Result<()>
fn set_pointer_builder<'b>( pointer: PointerBuilder<'b>, value: Reader<'a>, canonicalize: bool ) -> Result<()>
Copies the values from
input
into builder
, where builder
represents the backing memory of a <Receiver as Owned>::Builder
. Read moreimpl<'a> Copy for Reader<'a>
Auto Trait Implementations§
impl<'a> Freeze for Reader<'a>
impl<'a> !RefUnwindSafe for Reader<'a>
impl<'a> !Send for Reader<'a>
impl<'a> !Sync for Reader<'a>
impl<'a> Unpin for Reader<'a>
impl<'a> !UnwindSafe for Reader<'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