pub struct TokioExecutorService { /* private fields */ }Expand description
Implementations§
Source§impl TokioExecutorService
impl TokioExecutorService
Sourcepub fn new() -> TokioExecutorService
pub fn new() -> TokioExecutorService
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<<TokioExecutorService as ExecutorService>::Handle<R, E>, RejectedExecution>
fn submit_callable<C, R, E>( &self, task: C, ) -> Result<<TokioExecutorService as ExecutorService>::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,
) -> <TokioExecutorService as ExecutorService>::Termination<'_>
fn await_termination( &self, ) -> <TokioExecutorService as ExecutorService>::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.
Source§type Handle<R: Send + 'static, E: Send + 'static> = TokioTaskHandle<R, E>
type Handle<R: Send + 'static, E: Send + 'static> = TokioTaskHandle<R, E>
Source§type Termination<'a> = Pin<Box<dyn Future<Output = ()> + Send + 'a>>
where
TokioExecutorService: 'a
type Termination<'a> = Pin<Box<dyn Future<Output = ()> + Send + 'a>> where TokioExecutorService: 'a
Auto Trait Implementations§
impl Freeze for TokioExecutorService
impl RefUnwindSafe for TokioExecutorService
impl Send for TokioExecutorService
impl Sync for TokioExecutorService
impl Unpin for TokioExecutorService
impl UnsafeUnpin for TokioExecutorService
impl UnwindSafe for TokioExecutorService
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more