pub fn try_spawn_local_with_current_owner(
    fut: impl Future<Output = ()> + 'static,
    on_cancelled: impl FnOnce() + 'static,
) -> Result<(), ScopedFutureError>
Expand description

Runs a future that has access to the provided Owner’s scope context.

Since futures run in the background, it is possible that the scope has been cleaned up since the future started running. If this happens, the future will not be completed.

The on_cancelled callback can be used to notify you that the future was cancelled.

§Panics

Panics if there is no Owner context available.