Skip to main content

lift_callback_opt

Function lift_callback_opt 

Source
pub unsafe fn lift_callback_opt<C: CallbackInterface + ?Sized>(
    ctx: *mut c_void,
    vtable: *const C::Vtable,
    name: &str,
) -> Result<Option<Arc<C>>, FfiError>
Expand description

Lift an optional callback-interface parameter (Cb?): a null vtable is None.

§Errors

Returns a MARSHAL_ERROR_CODE error for a vtable smaller than the producer’s.

§Safety

Same contract as ForeignCallback::from_raw.