Skip to main content

task_opt_callbacks

Function task_opt_callbacks 

Source
pub unsafe fn task_opt_callbacks<FBefore, FEnter, FExit, FAfter>(
    f_before: FBefore,
    f_enter: FEnter,
    f_exit: FExit,
    f_after: FAfter,
) -> bool
where FBefore: Fn() -> Option<*const ()> + Sync + 'static, FEnter: Fn(*const ()) -> *const () + Sync + 'static, FExit: Fn(*const ()) + Sync + 'static, FAfter: Fn(*const ()) + Sync + 'static,
Expand description

Attempts to install process-wide task callbacks.

Uses the callback lifecycle described by task_callbacks. Returns true if this call installs the callbacks, or false if another registration has already won. Installed callbacks cannot be replaced or removed.

ยงSafety

The pointer lifetimes and callback thread-safety requirements of task_callbacks apply.