pub fn spawn_local_with<F, S, D>(
future: F,
schedule: S,
data: D,
) -> (Runnable<Checked<D>>, Task<F::Output>)
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.