pub unsafe fn spawn_unchecked_with<F, S, D>(
future: F,
schedule: S,
data: D,
) -> (Runnable<D>, Task<F::Output>)
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 notSend
, it must be used and dropped on the original thread. - If
data
is not'static
, borrowed variables must outlive itsRunnable
.