pub struct PokeOptionUninit<'mem> { /* private fields */ }Expand description
Allows initializing an uninitialized option
Implementations§
Source§impl<'mem> PokeOptionUninit<'mem>
impl<'mem> PokeOptionUninit<'mem>
Sourcepub fn vtable(&self) -> &'static OptionVTable
pub fn vtable(&self) -> &'static OptionVTable
Returns the option vtable
Sourcepub fn into_value(self) -> PokeValueUninit<'mem>
pub fn into_value(self) -> PokeValueUninit<'mem>
Get a reference to the underlying PokeValue
Sourcepub unsafe fn init_none(self) -> PokeOption<'mem>
pub unsafe fn init_none(self) -> PokeOption<'mem>
Initialize the option as None
§Safety
Caller must ensure that all safety requirements for initializing this option are met.
Sourcepub unsafe fn write<'a>(self, value: OpaqueConst<'a>) -> PokeOption<'mem>
pub unsafe fn write<'a>(self, value: OpaqueConst<'a>) -> PokeOption<'mem>
Initialize the option as Some, taking ownership of the given value
§Safety
Caller must ensure that all safety requirements for initializing this option are met and that the value type matches what the option expects.
Caller must free the memory pointed to by value after the option is initialized,
but must not drop it in place — it’s been copied bitwise into the option.
Sourcepub unsafe fn put<T>(self, value: T) -> PokeOption<'mem>
pub unsafe fn put<T>(self, value: T) -> PokeOption<'mem>
Initialize the option by providing a value of type T
§Safety
Caller must ensure that T matches the expected type of the option
and that all safety requirements for initializing this option are met.