pub struct PeekStruct<'mem> { /* private fields */ }Expand description
Lets you read from a struct (implements read-only struct operations)
Implementations§
Source§impl<'mem> PeekStruct<'mem>
impl<'mem> PeekStruct<'mem>
Sourcepub fn field_count(&self) -> usize
pub fn field_count(&self) -> usize
Returns the number of fields in this struct
Sourcepub fn field_name(&self, index: usize) -> Option<&'static str>
pub fn field_name(&self, index: usize) -> Option<&'static str>
Returns the name of the field at the given index
Sourcepub fn field_value(&self, index: usize) -> Option<Peek<'mem>>
pub fn field_value(&self, index: usize) -> Option<Peek<'mem>>
Returns the value of the field at the given index
Sourcepub fn get_field(&self, name: &str) -> Option<Peek<'mem>>
pub fn get_field(&self, name: &str) -> Option<Peek<'mem>>
Returns the value of the field with the given name
Methods from Deref<Target = PeekValue<'mem>>§
Sourcepub fn vtable(&self) -> &'static ValueVTable
pub fn vtable(&self) -> &'static ValueVTable
Returns the vtable
Sourcepub fn eq(&self, other: &PeekValue<'_>) -> Option<bool>
pub fn eq(&self, other: &PeekValue<'_>) -> Option<bool>
Returns true if this scalar is equal to the other scalar
§Returns
false if equality comparison is not supported for this scalar type
Sourcepub fn partial_cmp(&self, other: &PeekValue<'_>) -> Option<Ordering>
pub fn partial_cmp(&self, other: &PeekValue<'_>) -> Option<Ordering>
Compares this scalar with another and returns their ordering
§Returns
None if comparison is not supported for this scalar type
Sourcepub fn cmp(&self, other: &PeekValue<'_>) -> Option<Ordering>
pub fn cmp(&self, other: &PeekValue<'_>) -> Option<Ordering>
Compares this scalar with another and returns their ordering
§Returns
None if comparison is not supported for this scalar type
Sourcepub fn gt(&self, other: &PeekValue<'_>) -> bool
pub fn gt(&self, other: &PeekValue<'_>) -> bool
Returns true if this scalar is greater than the other scalar
§Returns
false if comparison is not supported for this scalar type
Sourcepub fn gte(&self, other: &PeekValue<'_>) -> bool
pub fn gte(&self, other: &PeekValue<'_>) -> bool
Returns true if this scalar is greater than or equal to the other scalar
§Returns
false if comparison is not supported for this scalar type
Sourcepub fn lt(&self, other: &PeekValue<'_>) -> bool
pub fn lt(&self, other: &PeekValue<'_>) -> bool
Returns true if this scalar is less than the other scalar
§Returns
false if comparison is not supported for this scalar type
Sourcepub fn lte(&self, other: &PeekValue<'_>) -> bool
pub fn lte(&self, other: &PeekValue<'_>) -> bool
Returns true if this scalar is less than or equal to the other scalar
§Returns
false if comparison is not supported for this scalar type
Sourcepub fn display(&self, f: &mut Formatter<'_>) -> Option<Result>
pub fn display(&self, f: &mut Formatter<'_>) -> Option<Result>
Formats this scalar for display
§Returns
None if display formatting is not supported for this scalar type
Sourcepub fn debug(&self, f: &mut Formatter<'_>) -> Option<Result>
pub fn debug(&self, f: &mut Formatter<'_>) -> Option<Result>
Formats this scalar for debug
§Returns
None if debug formatting is not supported for this scalar type
Sourcepub fn type_name(&self, f: &mut Formatter<'_>, opts: TypeNameOpts) -> Result
pub fn type_name(&self, f: &mut Formatter<'_>, opts: TypeNameOpts) -> Result
Sourcepub fn data(&self) -> OpaqueConst<'mem>
pub fn data(&self) -> OpaqueConst<'mem>
Returns the data
Sourcepub fn scalar_type(&self) -> Option<ScalarType>
pub fn scalar_type(&self) -> Option<ScalarType>
Get the scalar type if set.
Trait Implementations§
Source§impl<'mem> Clone for PeekStruct<'mem>
impl<'mem> Clone for PeekStruct<'mem>
Source§fn clone(&self) -> PeekStruct<'mem>
fn clone(&self) -> PeekStruct<'mem>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more