pub struct PeekEnum<'mem> { /* private fields */ }Expand description
Lets you read from an enum (implements read-only enum operations)
Implementations§
Source§impl<'mem> PeekEnum<'mem>
impl<'mem> PeekEnum<'mem>
Sourcepub fn variant_count(self) -> usize
pub fn variant_count(self) -> usize
Returns the number of variants in this enum
Sourcepub fn variant_name(self, index: usize) -> Option<&'static str>
pub fn variant_name(self, index: usize) -> Option<&'static str>
Returns the variant name at the given index
Sourcepub fn discriminant(self) -> i64
pub fn discriminant(self) -> i64
Returns the discriminant value for the current enum value
Sourcepub fn variant_index(self) -> usize
pub fn variant_index(self) -> usize
Returns the variant index for this enum value
Sourcepub fn active_variant(self) -> &'static Variant
pub fn active_variant(self) -> &'static Variant
Returns the active variant
Sourcepub fn variant_name_active(self) -> &'static str
pub fn variant_name_active(self) -> &'static str
Returns the name of the active variant for this enum value
Sourcepub fn variant_kind_active(self) -> &'static VariantKind
pub fn variant_kind_active(self) -> &'static VariantKind
Returns the kind of the active variant (Unit, Tuple, Struct)
Sourcepub fn field(self, field_name: &str) -> Option<Peek<'mem>>
pub fn field(self, field_name: &str) -> Option<Peek<'mem>>
Returns a Peek handle to a field of a tuple or struct variant
Sourcepub fn tuple_field(self, index: usize) -> Option<Peek<'mem>>
pub fn tuple_field(self, index: usize) -> Option<Peek<'mem>>
Returns a Peek handle to a field of a tuple variant by index
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.