Function spawn_local_with

Source
pub fn spawn_local_with<F, S, D>(
    future: F,
    schedule: S,
    data: D,
) -> (Runnable<Checked<D>>, Task<F::Output>)
where F: Future + 'static, F::Output: 'static, S: Fn(Runnable<Checked<D>>) + Send + Sync + 'static, D: 'static,
Expand description

Creates a new thread-local task with associated data.

This function is a combination of spawn_local() and spawn_with(), except it does not require Send on data. The data is wrapped in a type that implements Deref and [DerefMut][std::opts::DerefMut] and panics if used from another thread.

This function is only available when the std feature for this crate is enabled.