#[non_exhaustive]pub enum Peek<'mem> {
Value(PeekValue<'mem>),
List(PeekList<'mem>),
Map(PeekMap<'mem>),
Struct(PeekStruct<'mem>),
Enum(PeekEnum<'mem>),
Option(PeekOption<'mem>),
}Expand description
Lets you peek at the innards of a value
It’s possible (in some cases..) to escape the borrow checker by setting 'mem to 'static,
in which case, you’re entirely on your own.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Value(PeekValue<'mem>)
cf. PeekValue
List(PeekList<'mem>)
cf. PeekList
Map(PeekMap<'mem>)
cf. PeekMap
Struct(PeekStruct<'mem>)
cf. PeekStruct
Enum(PeekEnum<'mem>)
cf. PeekEnum
Option(PeekOption<'mem>)
cf. PeekOption
Implementations§
Source§impl<'mem> Peek<'mem>
impl<'mem> Peek<'mem>
Sourcepub fn new<S: Facet>(s: &'mem S) -> Self
pub fn new<S: Facet>(s: &'mem S) -> Self
Creates a new peek from a reference to some initialized value that implements Facet
Sourcepub unsafe fn unchecked_new(
data: OpaqueConst<'mem>,
shape: &'static Shape,
) -> Self
pub unsafe fn unchecked_new( data: OpaqueConst<'mem>, shape: &'static Shape, ) -> Self
Creates a new peek, for easy manipulation of some opaque data.
§Safety
data must be initialized and well-aligned, and point to a value
of the type described by shape.
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.