pub struct PokeValue<'mem> { /* private fields */ }Expand description
Lets you modify an initialized value (implements read-write ValueVTable proxies)
Implementations§
Source§impl<'mem> PokeValue<'mem>
impl<'mem> PokeValue<'mem>
Sourcepub fn into_value(self) -> Self
pub fn into_value(self) -> Self
Coerce back into a PokeValue
Sourcepub fn typed<T: Facet>(self) -> Result<TypedPokeValue<'mem, T>, Self>
pub fn typed<T: Facet>(self) -> Result<TypedPokeValue<'mem, T>, Self>
Converts to a type-checked TypedPokeValue<T> if the shape matches type T
Returns None if the shape doesn’t match the type T.
Sourcepub unsafe fn data(&mut self) -> Opaque<'mem>
pub unsafe fn data(&mut self) -> Opaque<'mem>
Exposes the internal data buffer as a mutable reference
§Safety
The caller must ensure that they don’t violate any invariants of the underlying type.
Sourcepub fn replace<'src, T>(self, value: T) -> Opaque<'mem>where
T: Facet + 'src,
pub fn replace<'src, T>(self, value: T) -> Opaque<'mem>where
T: Facet + 'src,
Replace the current value with a new one of the same type
This function replaces the existing value with a new one of type T, checking that T exactly matches the expected shape.
Sourcepub fn debug_fmt(&self, f: &mut Formatter<'_>) -> Result
pub fn debug_fmt(&self, f: &mut Formatter<'_>) -> Result
Format the value using its Debug implementation
Sourcepub fn display_fmt(&self, f: &mut Formatter<'_>) -> Result
pub fn display_fmt(&self, f: &mut Formatter<'_>) -> Result
Format the value using its Display implementation
Trait Implementations§
Auto Trait Implementations§
impl<'mem> Freeze for PokeValue<'mem>
impl<'mem> RefUnwindSafe for PokeValue<'mem>
impl<'mem> !Send for PokeValue<'mem>
impl<'mem> !Sync for PokeValue<'mem>
impl<'mem> Unpin for PokeValue<'mem>
impl<'mem> !UnwindSafe for PokeValue<'mem>
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