Skip to main content

ResultInitOkFn

Type Alias ResultInitOkFn 

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

Initialize a result with Ok(value)

§Safety

The result 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.