task_opt_callbacks

Function task_opt_callbacks 

Source
pub unsafe fn task_opt_callbacks<FBefore, FEnter, FExit, FAfter>(
    before: FBefore,
    enter: FEnter,
    exit: FExit,
    after: FAfter,
) -> bool
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 has a 'static lifetime. This pointer will be owned by the spawned task for the duration of that task, and ownership will be returned to the user at the end of the task via after. The pointer remains opaque to the runtime.

Returns false if task callbacks have already been set.