pub struct TokioExecutorService { /* private fields */ }Expand description
Implementations§
Trait Implementations§
Source§impl Clone for TokioExecutorService
impl Clone for TokioExecutorService
Source§fn clone(&self) -> TokioExecutorService
fn clone(&self) -> TokioExecutorService
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Default for TokioExecutorService
impl Default for TokioExecutorService
Source§fn default() -> TokioExecutorService
fn default() -> TokioExecutorService
Source§impl ExecutorService for TokioExecutorService
impl ExecutorService for TokioExecutorService
Source§fn submit_callable<C, R, E>(
&self,
task: C,
) -> Result<Self::Handle<R, E>, RejectedExecution>
fn submit_callable<C, R, E>( &self, task: C, ) -> Result<Self::Handle<R, E>, RejectedExecution>
Accepts a callable and runs it through Tokio.
§Parameters
task- Callable to execute on Tokio’s blocking task pool.
§Returns
A TokioTaskHandle for the accepted task.
§Errors
Returns RejectedExecution::Shutdown if shutdown has already been
requested before the task is accepted.
Source§fn shutdown(&self)
fn shutdown(&self)
Stops accepting new tasks.
Already accepted tasks are allowed to finish unless they are cancelled before their blocking closure starts.
Source§fn shutdown_now(&self) -> ShutdownReport
fn shutdown_now(&self) -> ShutdownReport
Stops accepting new tasks and requests abort for tracked Tokio tasks.
Tokio cannot abort blocking tasks that have already started. Such tasks continue running and keep the service active until their closure returns.
§Returns
A report with zero queued tasks, the observed active task count, and the number of Tokio abort handles signalled.
Source§fn is_shutdown(&self) -> bool
fn is_shutdown(&self) -> bool
Returns whether shutdown has been requested.
Source§fn is_terminated(&self) -> bool
fn is_terminated(&self) -> bool
Returns whether shutdown was requested and all tasks are finished.
Source§fn await_termination(&self) -> Self::Termination<'_>
fn await_termination(&self) -> Self::Termination<'_>
Waits until the service has terminated.
§Returns
A future that resolves after shutdown has been requested and all accepted Tokio blocking tasks have finished or were cancelled before their closures started.