Function spawn_cbs

Source
pub unsafe fn spawn_cbs<FBefore, FEnter, FExit, FAfter>(
    before: FBefore,
    enter: FEnter,
    exit: FExit,
    after: FAfter,
)
where FBefore: Fn() -> Option<*const ()> + 'static, FEnter: Fn(*const ()) -> *const () + 'static, FExit: Fn(*const ()) + 'static, FAfter: Fn(*const ()) + 'static,
Expand description

ยงSafety

The user must ensure that the pointer returned by before is 'static. It will become owned by the spawned task for the life of the task. Ownership of the pointer will be returned to the user at the end of the task via after. The pointer is opaque to the runtime.