pub struct LocalSpawner { /* private fields */ }Expand description
A capability for submitting Send work to a particular LocalDomain.
Implementations§
Source§impl LocalSpawner
impl LocalSpawner
Sourcepub fn spawn<F, T>(&self, future: F) -> Result<Task<T>, SpawnError>
pub fn spawn<F, T>(&self, future: F) -> Result<Task<T>, SpawnError>
Submits Send work for execution on the local domain’s owner thread.
§Errors
Returns SpawnError::Closed if the domain no longer exists or has
begun shutting down.
§Panics
Panics if the internal lifecycle mutex was poisoned by an earlier panic.
Sourcepub fn dispatch<F>(&self, callback: F) -> Result<(), SpawnError>
pub fn dispatch<F>(&self, callback: F) -> Result<(), SpawnError>
Dispatches a callback for fire-and-forget execution on the owner thread.
This avoids allocating a result-bearing Task. Panics are isolated so
they do not unwind through the owner drive loop; the process panic hook
still runs normally.
§Errors
Returns SpawnError::Closed if the domain no longer exists or has
begun shutting down.
§Panics
Panics if the internal lifecycle mutex was poisoned by an earlier panic.
Sourcepub fn dispatch_future<F>(&self, future: F) -> Result<(), SpawnError>
pub fn dispatch_future<F>(&self, future: F) -> Result<(), SpawnError>
Dispatches a future for fire-and-forget execution on the owner thread.
This avoids the result and cancellation bridge used by Self::spawn.
Panics are isolated so they do not unwind through the owner drive loop;
the process panic hook still runs normally.
§Errors
Returns SpawnError::Closed if the domain no longer exists or has
begun shutting down.
§Panics
Panics if the internal lifecycle mutex was poisoned by an earlier panic.
Trait Implementations§
Source§impl Clone for LocalSpawner
impl Clone for LocalSpawner
Source§fn clone(&self) -> LocalSpawner
fn clone(&self) -> LocalSpawner
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more