pub struct LocalScopeSpawner<'sc, T> { /* private fields */ }Expand description
A spawner that can be obtained from LocalScope::spawner.
This spawner may live longer then the scope.
In case a future is spawned after the scope has been canceled or dropped,
the spawner will return SpawnError::shutdown.
Implementations§
Source§impl<'sc, T> LocalScopeSpawner<'sc, T>
impl<'sc, T> LocalScopeSpawner<'sc, T>
Sourcepub fn spawn_scoped_local_obj(
&self,
future: LocalFutureObj<'sc, T>,
) -> Result<(), SpawnError>
pub fn spawn_scoped_local_obj( &self, future: LocalFutureObj<'sc, T>, ) -> Result<(), SpawnError>
Spawns a task that polls the given local future.
§Errors
This method returns a Result that contains a SpawnError if spawning fails.
Sourcepub fn spawn_local_scoped<Fut>(&self, future: Fut) -> Result<(), SpawnError>where
Fut: Future<Output = T> + 'sc,
pub fn spawn_local_scoped<Fut>(&self, future: Fut) -> Result<(), SpawnError>where
Fut: Future<Output = T> + 'sc,
Spawns a task that polls the given local future.
§Errors
This method returns a Result that contains a SpawnError if spawning fails.
Source§impl<'sc> LocalScopeSpawner<'sc, ()>
impl<'sc> LocalScopeSpawner<'sc, ()>
Sourcepub fn spawn_local_scoped_with_handle<Fut>(
&self,
future: Fut,
) -> Result<RemoteHandle<Fut::Output>, SpawnError>where
Fut: Future + 'sc,
pub fn spawn_local_scoped_with_handle<Fut>(
&self,
future: Fut,
) -> Result<RemoteHandle<Fut::Output>, SpawnError>where
Fut: Future + 'sc,
Spawns a task that polls the given local future and returns a handle to its output.
§Errors
This method returns a Result that contains a SpawnError if spawning fails.
Trait Implementations§
Source§impl<'sc, T> Clone for LocalScopeSpawner<'sc, T>
impl<'sc, T> Clone for LocalScopeSpawner<'sc, T>
Source§impl<'sc, T: Debug> Debug for LocalScopeSpawner<'sc, T>
impl<'sc, T: Debug> Debug for LocalScopeSpawner<'sc, T>
Source§impl<'sc> LocalSpawn for LocalScopeSpawner<'sc, ()>
impl<'sc> LocalSpawn for LocalScopeSpawner<'sc, ()>
Source§fn spawn_local_obj(
&self,
future: LocalFutureObj<'static, ()>,
) -> Result<(), SpawnError>
fn spawn_local_obj( &self, future: LocalFutureObj<'static, ()>, ) -> Result<(), SpawnError>
Spawns a future that will be run to completion. Read more
Source§fn status_local(&self) -> Result<(), SpawnError>
fn status_local(&self) -> Result<(), SpawnError>
Determines whether the executor is able to spawn new tasks. Read more
Source§impl<'sc, T> ScopedSpawn<'sc, T> for LocalScopeSpawner<'sc, T>
impl<'sc, T> ScopedSpawn<'sc, T> for LocalScopeSpawner<'sc, T>
Source§fn spawn_obj_scoped(&self, future: FutureObj<'sc, T>) -> Result<(), SpawnError>
fn spawn_obj_scoped(&self, future: FutureObj<'sc, T>) -> Result<(), SpawnError>
Spawns a task that polls the given future. Read more
Source§fn status_scoped(&self) -> Result<(), SpawnError>
fn status_scoped(&self) -> Result<(), SpawnError>
Determines whether the scope is able to spawn new tasks. Read more
Source§impl<'sc> Spawn for LocalScopeSpawner<'sc, ()>
impl<'sc> Spawn for LocalScopeSpawner<'sc, ()>
Auto Trait Implementations§
impl<'sc, T> Freeze for LocalScopeSpawner<'sc, T>
impl<'sc, T> !RefUnwindSafe for LocalScopeSpawner<'sc, T>
impl<'sc, T> !Send for LocalScopeSpawner<'sc, T>
impl<'sc, T> !Sync for LocalScopeSpawner<'sc, T>
impl<'sc, T> Unpin for LocalScopeSpawner<'sc, T>
impl<'sc, T> !UnwindSafe for LocalScopeSpawner<'sc, T>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Sp> LocalSpawnExt for Spwhere
Sp: LocalSpawn + ?Sized,
impl<Sp> LocalSpawnExt for Spwhere
Sp: LocalSpawn + ?Sized,
Source§fn spawn_local<Fut>(&self, future: Fut) -> Result<(), SpawnError>
fn spawn_local<Fut>(&self, future: Fut) -> Result<(), SpawnError>
Spawns a task that polls the given future with output
() to
completion. Read moreSource§fn spawn_local_with_handle<Fut>(
&self,
future: Fut,
) -> Result<RemoteHandle<<Fut as Future>::Output>, SpawnError>where
Fut: Future + 'static,
fn spawn_local_with_handle<Fut>(
&self,
future: Fut,
) -> Result<RemoteHandle<<Fut as Future>::Output>, SpawnError>where
Fut: Future + 'static,
Spawns a task that polls the given future to completion and returns a
future that resolves to the spawned future’s output. Read more
Source§impl<Sp> RelayScopeLocalSpawning for Spwhere
Sp: LocalSpawn + Clone,
impl<Sp> RelayScopeLocalSpawning for Spwhere
Sp: LocalSpawn + Clone,
Source§fn spawn_scope<'sc>(&self, scope: &RelayScope<'sc>) -> Result<(), SpawnError>where
Self: 'sc,
fn spawn_scope<'sc>(&self, scope: &RelayScope<'sc>) -> Result<(), SpawnError>where
Self: 'sc,
Add this spawn to
scope and relay spawned futures to it.Source§impl<'sc, T, Sp> ScopedSpawnExt<'sc, T> for Spwhere
Sp: ScopedSpawn<'sc, T> + ?Sized,
impl<'sc, T, Sp> ScopedSpawnExt<'sc, T> for Spwhere
Sp: ScopedSpawn<'sc, T> + ?Sized,
Source§fn spawn_scoped<Fut>(&self, future: Fut) -> Result<(), SpawnError>
fn spawn_scoped<Fut>(&self, future: Fut) -> Result<(), SpawnError>
Spawns a task that polls the given future. Read more
Source§fn spawn_scoped_with_handle<Fut>(
&self,
future: Fut,
) -> Result<RemoteHandle<Fut::Output>, SpawnError>
fn spawn_scoped_with_handle<Fut>( &self, future: Fut, ) -> Result<RemoteHandle<Fut::Output>, SpawnError>
Spawns a task that polls the given future and returns a handle to its output. Read more
Source§impl<Sp> SpawnExt for Sp
impl<Sp> SpawnExt for Sp
Source§fn spawn<Fut>(&self, future: Fut) -> Result<(), SpawnError>
fn spawn<Fut>(&self, future: Fut) -> Result<(), SpawnError>
Spawns a task that polls the given future with output
() to
completion. Read moreSource§fn spawn_with_handle<Fut>(
&self,
future: Fut,
) -> Result<RemoteHandle<<Fut as Future>::Output>, SpawnError>
fn spawn_with_handle<Fut>( &self, future: Fut, ) -> Result<RemoteHandle<<Fut as Future>::Output>, SpawnError>
Spawns a task that polls the given future to completion and returns a
future that resolves to the spawned future’s output. Read more