pub struct LocalSpawner { /* private fields */ }Expand description
A handle to a LocalPool that implements Spawn and
LocalSpawn.
Implementations§
Source§impl LocalSpawner
impl LocalSpawner
Sourcepub fn enter<F, T>(self, enter: &mut Enter, f: F) -> T
pub fn enter<F, T>(self, enter: &mut Enter, f: F) -> T
Enter a spawner.
Clears the current spawner when f returns.
current_local needs this to work.
A runtime (combining reactor, pool, …) should enter a spawner handle (in each thread it runs tasks from the pool) so all tasks have access to the spawner.
§Panics
Panics if a spawner is already entered.
Trait Implementations§
Source§impl Clone for LocalSpawner
impl Clone for LocalSpawner
Source§fn clone(&self) -> LocalSpawner
fn clone(&self) -> LocalSpawner
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LocalSpawner
impl Debug for LocalSpawner
Source§impl LocalSpawn for LocalSpawner
impl LocalSpawn for LocalSpawner
Source§fn spawn_local_obj(
&mut self,
future: LocalFutureObj<'static, ()>,
) -> Result<(), SpawnError>
fn spawn_local_obj( &mut 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 Spawn for LocalSpawner
impl Spawn for LocalSpawner
Auto Trait Implementations§
impl Freeze for LocalSpawner
impl !RefUnwindSafe for LocalSpawner
impl !Send for LocalSpawner
impl !Sync for LocalSpawner
impl Unpin for LocalSpawner
impl !UnwindSafe for LocalSpawner
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>(&mut self, future: Fut) -> Result<(), SpawnError>
fn spawn_local<Fut>(&mut self, future: Fut) -> Result<(), SpawnError>
Spawns a task that polls the given future with output
() to
completion. Read more