pub struct PokeValueUninit<'mem> { /* private fields */ }Expand description
Lets you write to a value (implements write-only ValueVTable proxies)
Implementations§
Source§impl<'mem> PokeValueUninit<'mem>
impl<'mem> PokeValueUninit<'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<TypedPokeValueUninit<'mem, T>, Self>
pub fn typed<T: Facet>(self) -> Result<TypedPokeValueUninit<'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) -> OpaqueUninit<'mem>
pub unsafe fn data(&mut self) -> OpaqueUninit<'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 try_from<'src>(
self,
source: OpaqueConst<'src>,
) -> Result<Opaque<'mem>, (Self, TryFromError)>
pub fn try_from<'src>( self, source: OpaqueConst<'src>, ) -> Result<Opaque<'mem>, (Self, TryFromError)>
Attempts to convert a value from another type into this one
Returns Ok(Opaque) if the conversion was successful, Err((Self, TryFromError)) otherwise.
Sourcepub fn parse(self, s: &str) -> Result<Opaque<'mem>, Self>
pub fn parse(self, s: &str) -> Result<Opaque<'mem>, Self>
Attempts to parse a string into this value
Returns Ok(Opaque) if parsing was successful, Err(Self) otherwise.
Sourcepub fn put<'src, T>(self, value: T) -> Opaque<'mem>where
T: Facet + 'src,
pub fn put<'src, T>(self, value: T) -> Opaque<'mem>where
T: Facet + 'src,
Place a value in the space provided. See also Self::typed, which
is panic-free.
This function places a value of type T into the destination space, checking that T exactly matches the expected shape.
Sourcepub fn default_in_place(self) -> Result<Opaque<'mem>, Self>
pub fn default_in_place(self) -> Result<Opaque<'mem>, Self>
Attempts to set the value to its default
Returns Ok(Opaque) if setting to default was successful, Err(Self) otherwise.
Sourcepub fn clone_from<'src>(self, source: Peek<'src>) -> Result<Peek<'mem>, Self>
pub fn clone_from<'src>(self, source: Peek<'src>) -> Result<Peek<'mem>, Self>
Attempts to clone source into this value
Returns Ok(Peek) if cloning was successful, Err(Self) otherwise.