#[non_exhaustive]pub enum Poke<'mem> {
Scalar(PokeValue<'mem>),
List(PokeList<'mem>),
Map(PokeMap<'mem>),
Struct(PokeStruct<'mem>),
Enum(PokeEnum<'mem>),
Option(PokeOption<'mem>),
SmartPointer(PokeSmartPointer<'mem>),
}Expand description
Allows manipulating already-initialized values of different kinds.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Scalar(PokeValue<'mem>)
A scalar value. See PokeValue.
List(PokeList<'mem>)
A list (array/vec/etc). See PokeList.
Map(PokeMap<'mem>)
A map (HashMap/BTreeMap/etc). See PokeMap.
Struct(PokeStruct<'mem>)
A struct, tuple struct, or tuple. See PokeStruct.
Enum(PokeEnum<'mem>)
An enum variant. See PokeEnum.
Option(PokeOption<'mem>)
An option value. See PokeOption.
SmartPointer(PokeSmartPointer<'mem>)
A smart pointer. See PokeSmartPointer.
Implementations§
Source§impl<'mem> Poke<'mem>
impl<'mem> Poke<'mem>
Sourcepub unsafe fn unchecked_new(data: Opaque<'mem>, shape: &'static Shape) -> Self
pub unsafe fn unchecked_new(data: Opaque<'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.
Sourcepub fn borrow<T: Facet>(data: &'mem mut T) -> Poke<'mem>
pub fn borrow<T: Facet>(data: &'mem mut T) -> Poke<'mem>
Borrows the value for a different kind of inspection.
Sourcepub fn into_smart_pointer(self) -> PokeSmartPointer<'mem>
pub fn into_smart_pointer(self) -> PokeSmartPointer<'mem>
Converts this Poke into a PokeSmartPointer, panicking if it’s not a SmartPointer variant
Sourcepub fn into_scalar(self) -> PokeValue<'mem>
pub fn into_scalar(self) -> PokeValue<'mem>
Converts this Poke into a PokeValue, panicking if it’s not a Scalar variant
Sourcepub fn into_list(self) -> PokeList<'mem>
pub fn into_list(self) -> PokeList<'mem>
Converts this Poke into a PokeList, panicking if it’s not a List variant
Sourcepub fn into_map(self) -> PokeMap<'mem>
pub fn into_map(self) -> PokeMap<'mem>
Converts this Poke into a PokeMap, panicking if it’s not a Map variant
Sourcepub fn into_struct(self) -> PokeStruct<'mem>
pub fn into_struct(self) -> PokeStruct<'mem>
Converts this Poke into a PokeStruct, panicking if it’s not a Struct variant
Sourcepub fn into_enum(self) -> PokeEnum<'mem>
pub fn into_enum(self) -> PokeEnum<'mem>
Converts this Poke into a PokeEnum, panicking if it’s not an Enum variant
Sourcepub fn into_option(self) -> PokeOption<'mem>
pub fn into_option(self) -> PokeOption<'mem>
Converts this Poke into a PokeOption, panicking if it’s not an Option variant