Struct tokio::runtime::current_thread::TaskExecutor
source · pub struct TaskExecutor { /* private fields */ }
Expand description
Executes futures on the current thread.
All futures executed using this executor will be executed on the current
thread. As such, run
will wait for these futures to complete before
returning.
For more details, see the module level documentation.
Implementations§
source§impl TaskExecutor
impl TaskExecutor
sourcepub fn current() -> TaskExecutor
pub fn current() -> TaskExecutor
Returns an executor that executes futures on the current thread.
The user of TaskExecutor
must ensure that when a future is submitted,
that it is done within the context of a call to run
.
For more details, see the module level documentation.
sourcepub fn spawn_local(
&mut self,
future: Box<dyn Future<Error = (), Item = ()> + 'static, Global>
) -> Result<(), SpawnError>
pub fn spawn_local(
&mut self,
future: Box<dyn Future<Error = (), Item = ()> + 'static, Global>
) -> Result<(), SpawnError>
Spawn a future onto the current CurrentThread
instance.
Trait Implementations§
source§impl Clone for TaskExecutor
impl Clone for TaskExecutor
source§fn clone(&self) -> TaskExecutor
fn clone(&self) -> TaskExecutor
Returns a copy 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 more