pub struct PokeOption<'mem> { /* private fields */ }Expand description
Allows poking an option (setting Some/None)
Implementations§
Source§impl<'mem> PokeOption<'mem>
impl<'mem> PokeOption<'mem>
Sourcepub fn vtable(&self) -> &'static OptionVTable
pub fn vtable(&self) -> &'static OptionVTable
Returns the option vtable
Sourcepub fn replace_with_none(self) -> Self
pub fn replace_with_none(self) -> Self
Replace the current value with None
Sourcepub fn replace_with_some<T>(self, value: T) -> Self
pub fn replace_with_some<T>(self, value: T) -> Self
Replace the current value with Some
Sourcepub fn into_value(self) -> PokeValueUninit<'mem>
pub fn into_value(self) -> PokeValueUninit<'mem>
Get a reference to the underlying value
Sourcepub fn build<T: Facet>(self, guard: Option<Guard>) -> Option<T>
pub fn build<T: Facet>(self, guard: Option<Guard>) -> Option<T>
Builds an Option<T> from the PokeOption, then deallocates the memory
that this PokeOption was pointing to.
§Panics
This function will panic if:
- The generic type parameter T does not match the shape that this PokeOption is building.
Auto Trait Implementations§
impl<'mem> Freeze for PokeOption<'mem>
impl<'mem> RefUnwindSafe for PokeOption<'mem>
impl<'mem> !Send for PokeOption<'mem>
impl<'mem> !Sync for PokeOption<'mem>
impl<'mem> Unpin for PokeOption<'mem>
impl<'mem> !UnwindSafe for PokeOption<'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