pub struct TokioRuntime;Expand description
Tokio is the default asynchronous executor.
Trait Implementations§
Source§impl AsyncRuntime for TokioRuntime
impl AsyncRuntime for TokioRuntime
Source§type JoinError = JoinError
type JoinError = JoinError
The error type of
Self::JoinHandle.Source§type JoinHandle<T: OptionalSend + 'static> = JoinHandle<T>
type JoinHandle<T: OptionalSend + 'static> = JoinHandle<T>
The return type of
Self::spawn.Source§type TimeoutError = Elapsed
type TimeoutError = Elapsed
The timeout error type.
Source§type Timeout<R, T: Future<Output = R> + OptionalSend> = Timeout<T>
type Timeout<R, T: Future<Output = R> + OptionalSend> = Timeout<T>
The timeout type used by
Self::timeout and Self::timeout_at that enables the user
to await the outcome of a Future.Source§type ThreadLocalRng = ThreadRng
type ThreadLocalRng = ThreadRng
Type of a thread-local random number generator.
Source§type OneshotSender<T: OptionalSend> = TokioOneShotSender<T>
type OneshotSender<T: OptionalSend> = TokioOneShotSender<T>
Type of a
oneshot sender.Source§type OneshotReceiver<T: OptionalSend> = Receiver<T>
type OneshotReceiver<T: OptionalSend> = Receiver<T>
Type of a
oneshot receiver.Source§type OneshotReceiverError = RecvError
type OneshotReceiverError = RecvError
Type of a
oneshot receiver error.Source§fn spawn<T>(
future: T,
) -> <TokioRuntime as AsyncRuntime>::JoinHandle<<T as Future>::Output>
fn spawn<T>( future: T, ) -> <TokioRuntime as AsyncRuntime>::JoinHandle<<T as Future>::Output>
Spawn a new task.
Source§fn sleep(duration: Duration) -> <TokioRuntime as AsyncRuntime>::Sleep
fn sleep(duration: Duration) -> <TokioRuntime as AsyncRuntime>::Sleep
Wait until
duration has elapsed.Source§fn sleep_until(
deadline: <TokioRuntime as AsyncRuntime>::Instant,
) -> <TokioRuntime as AsyncRuntime>::Sleep
fn sleep_until( deadline: <TokioRuntime as AsyncRuntime>::Instant, ) -> <TokioRuntime as AsyncRuntime>::Sleep
Wait until
deadline is reached.Source§fn timeout<R, F>(
duration: Duration,
future: F,
) -> <TokioRuntime as AsyncRuntime>::Timeout<R, F>where
F: Future<Output = R> + OptionalSend,
fn timeout<R, F>(
duration: Duration,
future: F,
) -> <TokioRuntime as AsyncRuntime>::Timeout<R, F>where
F: Future<Output = R> + OptionalSend,
Require a
Future to complete before the specified duration has elapsed.Source§fn timeout_at<R, F>(
deadline: <TokioRuntime as AsyncRuntime>::Instant,
future: F,
) -> <TokioRuntime as AsyncRuntime>::Timeout<R, F>where
F: Future<Output = R> + OptionalSend,
fn timeout_at<R, F>(
deadline: <TokioRuntime as AsyncRuntime>::Instant,
future: F,
) -> <TokioRuntime as AsyncRuntime>::Timeout<R, F>where
F: Future<Output = R> + OptionalSend,
Require a
Future to complete before the specified instant in time.Source§fn is_panic(join_error: &<TokioRuntime as AsyncRuntime>::JoinError) -> bool
fn is_panic(join_error: &<TokioRuntime as AsyncRuntime>::JoinError) -> bool
Check if the
Self::JoinError is panic.Source§fn thread_rng() -> <TokioRuntime as AsyncRuntime>::ThreadLocalRng
fn thread_rng() -> <TokioRuntime as AsyncRuntime>::ThreadLocalRng
Get the random number generator to use for generating random numbers. Read more
Source§fn oneshot<T>() -> (<TokioRuntime as AsyncRuntime>::OneshotSender<T>, <TokioRuntime as AsyncRuntime>::OneshotReceiver<T>)where
T: OptionalSend,
fn oneshot<T>() -> (<TokioRuntime as AsyncRuntime>::OneshotSender<T>, <TokioRuntime as AsyncRuntime>::OneshotReceiver<T>)where
T: OptionalSend,
Creates a new one-shot channel for sending single values. Read more
Source§impl Debug for TokioRuntime
impl Debug for TokioRuntime
Source§impl Default for TokioRuntime
impl Default for TokioRuntime
Source§fn default() -> TokioRuntime
fn default() -> TokioRuntime
Returns the “default value” for a type. Read more
impl Eq for TokioRuntime
Source§impl PartialEq for TokioRuntime
impl PartialEq for TokioRuntime
Source§fn eq(&self, other: &TokioRuntime) -> bool
fn eq(&self, other: &TokioRuntime) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for TokioRuntime
Auto Trait Implementations§
impl Freeze for TokioRuntime
impl RefUnwindSafe for TokioRuntime
impl Send for TokioRuntime
impl Sync for TokioRuntime
impl Unpin for TokioRuntime
impl UnsafeUnpin for TokioRuntime
impl UnwindSafe for TokioRuntime
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
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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