spawn_protected

Function spawn_protected 

Source
pub fn spawn_protected(f: impl Future<Output = ()> + 'static) -> TaskHandle
Expand description

Spawns a task attached to the current method.

When the task is awoken, if a different method is currently running, the task will not run until the method it is attached to continues. If the attached method returns before the task completes, the task will be canceled.