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 (const: unstable) · 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<T, E>(&self, task: T) -> Result<(), SubmissionError>
fn submit<T, E>(&self, task: T) -> Result<(), SubmissionError>
Accepts a runnable and runs it through Tokio.
§Parameters
task- Runnable to execute on Tokio’s blocking task pool.
§Returns
Ok(()) if the task was accepted.
§Errors
Returns SubmissionError::Shutdown if shutdown has already been
requested before the task is accepted. Returns
SubmissionError::WorkerSpawnFailed if the current thread is not
entered into a Tokio runtime.
Source§fn submit_callable<C, R, E>(
&self,
task: C,
) -> Result<<TokioExecutorService as ExecutorService>::ResultHandle<R, E>, SubmissionError>
fn submit_callable<C, R, E>( &self, task: C, ) -> Result<<TokioExecutorService as ExecutorService>::ResultHandle<R, E>, SubmissionError>
Accepts a callable and runs it through Tokio.
§Parameters
task- Callable to execute on Tokio’s blocking task pool.
§Returns
A TaskHandle for the accepted task.
§Errors
Returns SubmissionError::Shutdown if shutdown has already been
requested before the task is accepted. Returns
SubmissionError::WorkerSpawnFailed if the current thread is not
entered into a Tokio runtime.
Source§fn submit_tracked_callable<C, R, E>(
&self,
task: C,
) -> Result<<TokioExecutorService as ExecutorService>::TrackedHandle<R, E>, SubmissionError>
fn submit_tracked_callable<C, R, E>( &self, task: C, ) -> Result<<TokioExecutorService as ExecutorService>::TrackedHandle<R, E>, SubmissionError>
Accepts a callable and returns an actively tracked handle.
§Parameters
task- Callable to execute on Tokio’s blocking task pool.
§Returns
A TokioBlockingTaskHandle for the accepted task.
§Errors
Returns SubmissionError::Shutdown if shutdown has already been
requested before the task is accepted. Returns
SubmissionError::WorkerSpawnFailed if the current thread is not
entered into a Tokio runtime.
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 stop(&self) -> StopReport
fn stop(&self) -> StopReport
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 queued and running blocking task counts observed when stop was requested, plus the number of queued blocking tasks that were actually cancelled before their blocking closures started.
Source§fn lifecycle(&self) -> ExecutorServiceLifecycle
fn lifecycle(&self) -> ExecutorServiceLifecycle
Returns the current lifecycle state.
Source§fn is_not_running(&self) -> bool
fn is_not_running(&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 wait_termination(&self)
fn wait_termination(&self)
Blocks until the service has terminated.
Source§type ResultHandle<R: Send + 'static, E: Send + 'static> = TaskHandle<R, E>
type ResultHandle<R: Send + 'static, E: Send + 'static> = TaskHandle<R, E>
Source§type TrackedHandle<R: Send + 'static, E: Send + 'static> = TokioBlockingTaskHandle<R, E>
type TrackedHandle<R: Send + 'static, E: Send + 'static> = TokioBlockingTaskHandle<R, E>
Source§fn submit_tracked<T, E>(
&self,
task: T,
) -> Result<Self::TrackedHandle<(), E>, SubmissionError>
fn submit_tracked<T, E>( &self, task: T, ) -> Result<Self::TrackedHandle<(), E>, SubmissionError>
Source§fn is_running(&self) -> bool
fn is_running(&self) -> bool
Source§fn is_shutting_down(&self) -> bool
fn is_shutting_down(&self) -> bool
Source§fn is_stopping(&self) -> bool
fn is_stopping(&self) -> bool
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> DropFlavorWrapper<T> for T
impl<T> DropFlavorWrapper<T> for T
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
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