pub struct Spawner { /* private fields */ }Implementations§
Source§impl Spawner
impl Spawner
Sourcepub fn spawn<F, T>(
&self,
priority: Priority,
future: F,
) -> Result<Task<T>, SpawnError>
pub fn spawn<F, T>( &self, priority: Priority, future: F, ) -> Result<Task<T>, SpawnError>
Submits a task to one priority queue.
A successful return means the task was admitted into the runtime’s lifecycle. A concurrent forced or timed shutdown may cancel it before its first poll; graceful shutdown still waits for it to reach a terminal state.
§Errors
Returns SpawnError::Closed if the runtime no longer exists or has
begun shutting down.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Spawner
impl RefUnwindSafe for Spawner
impl Send for Spawner
impl Sync for Spawner
impl Unpin for Spawner
impl UnsafeUnpin for Spawner
impl UnwindSafe for Spawner
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more