Function spawn_unchecked_with

Source
pub unsafe fn spawn_unchecked_with<F, S, D>(
    future: F,
    schedule: S,
    data: D,
) -> (Runnable<D>, Task<F::Output>)
where F: Future, S: Fn(Runnable<D>),
Expand description

Creates a new task with associated data and without Send, Sync, and 'static bounds.

This function is a combination of spawn_unchecked() and spawn_with(), except it does not require Send and 'static on data.

ยงSafety

  • All of the requirements from spawn_unchecked.
  • If data is not Send, it must be used and dropped on the original thread.
  • If data is not 'static, borrowed variables must outlive its Runnable.