Skip to main content

OptionInitSomeFn

Type Alias OptionInitSomeFn 

Source
pub type OptionInitSomeFn = unsafe extern "C" fn(option: PtrUninit, value: PtrMut) -> PtrMut;
Expand description

Initialize an option with Some(value)

§Safety

The option parameter must point to uninitialized memory of sufficient size. The function must properly initialize the memory. value is moved out of (with core::ptr::read) — it should be deallocated afterwards (e.g. with core::mem::forget) but NOT dropped. Note: value must be PtrMut (not PtrConst) because ownership is transferred and the value may be dropped later, which requires mutable access.