pub struct PeekStruct<'mem, 'facet> { /* private fields */ }Expand description
Lets you read from a struct (implements read-only struct operations)
Implementations§
Source§impl<'mem, 'facet> PeekStruct<'mem, 'facet>
impl<'mem, 'facet> PeekStruct<'mem, 'facet>
Sourcepub fn ty(&self) -> &StructType
pub fn ty(&self) -> &StructType
Returns the struct definition
Sourcepub fn field_count(&self) -> usize
pub fn field_count(&self) -> usize
Returns the number of fields in this struct
Sourcepub fn field(&self, index: usize) -> Result<Peek<'mem, 'facet>, FieldError>
pub fn field(&self, index: usize) -> Result<Peek<'mem, 'facet>, FieldError>
Returns the value of the field at the given index
Sourcepub fn field_by_name(
&self,
name: &str,
) -> Result<Peek<'mem, 'facet>, FieldError>
pub fn field_by_name( &self, name: &str, ) -> Result<Peek<'mem, 'facet>, FieldError>
Gets the value of the field with the given name
Trait Implementations§
Source§impl<'mem, 'facet> Clone for PeekStruct<'mem, 'facet>
impl<'mem, 'facet> Clone for PeekStruct<'mem, 'facet>
Source§fn clone(&self) -> PeekStruct<'mem, 'facet>
fn clone(&self) -> PeekStruct<'mem, 'facet>
Returns a duplicate 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 Debug for PeekStruct<'_, '_>
impl Debug for PeekStruct<'_, '_>
Source§impl<'mem, 'facet> HasFields<'mem, 'facet> for PeekStruct<'mem, 'facet>
impl<'mem, 'facet> HasFields<'mem, 'facet> for PeekStruct<'mem, 'facet>
Source§fn fields(&self) -> FieldIter<'mem, 'facet> ⓘ
fn fields(&self) -> FieldIter<'mem, 'facet> ⓘ
Iterates over all fields in this struct, providing both name and value
Source§fn fields_for_serialize(&self) -> FieldsForSerializeIter<'mem, 'facet> ⓘ
fn fields_for_serialize(&self) -> FieldsForSerializeIter<'mem, 'facet> ⓘ
Iterates over fields in this type that should be included when it is serialized
impl<'mem, 'facet> Copy for PeekStruct<'mem, 'facet>
Auto Trait Implementations§
impl<'mem, 'facet> Freeze for PeekStruct<'mem, 'facet>
impl<'mem, 'facet> RefUnwindSafe for PeekStruct<'mem, 'facet>
impl<'mem, 'facet> !Send for PeekStruct<'mem, 'facet>
impl<'mem, 'facet> !Sync for PeekStruct<'mem, 'facet>
impl<'mem, 'facet> Unpin for PeekStruct<'mem, 'facet>
impl<'mem, 'facet> UnwindSafe for PeekStruct<'mem, 'facet>
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