pub struct TokioRuntimeExecutor { /* private fields */ }
Expand description
Tokio executor with an explicit Runtime
Implementations§
Source§impl TokioRuntimeExecutor
impl TokioRuntimeExecutor
Sourcepub fn with_single_thread() -> Result<Self>
pub fn with_single_thread() -> Result<Self>
Creates a tokio runtime with the current thread scheduler selected.
Sourcepub fn with_multi_thread() -> Result<Self>
pub fn with_multi_thread() -> Result<Self>
Creates a tokio runtime with multi-thread scheduler selected.
Sourcepub fn with_runtime(runtime: Runtime) -> Self
pub fn with_runtime(runtime: Runtime) -> Self
Create an executor with the supplied Runtime
.
Trait Implementations§
Source§impl Clone for TokioRuntimeExecutor
impl Clone for TokioRuntimeExecutor
Source§fn clone(&self) -> TokioRuntimeExecutor
fn clone(&self) -> TokioRuntimeExecutor
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 TokioRuntimeExecutor
impl Debug for TokioRuntimeExecutor
Source§impl Executor for TokioRuntimeExecutor
impl Executor for TokioRuntimeExecutor
Source§fn spawn<F>(&self, future: F) -> JoinHandle<F::Output> ⓘ
fn spawn<F>(&self, future: F) -> JoinHandle<F::Output> ⓘ
Spawns a new asynchronous task in the background, returning a Future
JoinHandle
for it.Source§fn spawn_abortable<F>(&self, future: F) -> AbortableJoinHandle<F::Output> ⓘ
fn spawn_abortable<F>(&self, future: F) -> AbortableJoinHandle<F::Output> ⓘ
Spawns a new asynchronous task in the background, returning an abortable handle that will cancel the task
once the handle is dropped. Read more
Source§fn dispatch<F>(&self, future: F)
fn dispatch<F>(&self, future: F)
Spawns a new asynchronous task in the background without an handle.
Basically the same as
Executor::spawn
.Source§fn spawn_coroutine<T, F, Fut>(&self, f: F) -> CommunicationTask<T>
fn spawn_coroutine<T, F, Fut>(&self, f: F) -> CommunicationTask<T>
Spawns a new asynchronous task that accepts messages to the task using
channels
.
This function returns a handle that allows sending a message, or if there is no reference to the handle at all
(in other words, all handles are dropped), the task would be aborted.Source§fn spawn_coroutine_with_context<T, F, C, Fut>(
&self,
context: C,
f: F,
) -> CommunicationTask<T>
fn spawn_coroutine_with_context<T, F, C, Fut>( &self, context: C, f: F, ) -> CommunicationTask<T>
Spawns a new asynchronous task with provided context that accepts messages to the task using
channels
.
This function returns a handle that allows sending a message, or if there is no reference to the handle at all
(in other words, all handles are dropped), the task would be aborted.Source§fn spawn_unbounded_coroutine<T, F, Fut>(
&self,
f: F,
) -> UnboundedCommunicationTask<T>
fn spawn_unbounded_coroutine<T, F, Fut>( &self, f: F, ) -> UnboundedCommunicationTask<T>
Spawns a new asynchronous task that accepts messages to the task using
channels
.
This function returns a handle that allows sending a message, or if there is no reference to the handle at all
(in other words, all handles are dropped), the task would be aborted.Source§fn spawn_unbounded_coroutine_with_context<T, F, C, Fut>(
&self,
context: C,
f: F,
) -> UnboundedCommunicationTask<T>
fn spawn_unbounded_coroutine_with_context<T, F, C, Fut>( &self, context: C, f: F, ) -> UnboundedCommunicationTask<T>
Spawns a new asynchronous task with provided context that accepts messages to the task using
channels
.
This function returns a handle that allows sending a message, or if there is no reference to the handle at all
(in other words, all handles are dropped), the task would be aborted.Auto Trait Implementations§
impl Freeze for TokioRuntimeExecutor
impl RefUnwindSafe for TokioRuntimeExecutor
impl Send for TokioRuntimeExecutor
impl Sync for TokioRuntimeExecutor
impl Unpin for TokioRuntimeExecutor
impl UnwindSafe for TokioRuntimeExecutor
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