Struct openraft::async_runtime::TokioRuntime
source · pub struct TokioRuntime;
Expand description
Tokio
is the default asynchronous executor.
Trait Implementations§
source§impl AsyncRuntime for TokioRuntime
impl AsyncRuntime for TokioRuntime
§type JoinError = JoinError
type JoinError = JoinError
The error type of
Self::JoinHandle
.§type JoinHandle<T: OptionalSend + 'static> = JoinHandle<T>
type JoinHandle<T: OptionalSend + 'static> = JoinHandle<T>
The return type of
Self::spawn
.§type TimeoutError = Elapsed
type TimeoutError = Elapsed
The timeout error type.
§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
.§type ThreadLocalRng = ThreadRng
type ThreadLocalRng = ThreadRng
Type of a thread-local random number generator.
§type OneshotSender<T: OptionalSend> = TokioOneShotSender<T>
type OneshotSender<T: OptionalSend> = TokioOneShotSender<T>
Type of a
oneshot
sender.§type OneshotReceiver<T: OptionalSend> = Receiver<T>
type OneshotReceiver<T: OptionalSend> = Receiver<T>
Type of a
oneshot
receiver.§type OneshotReceiverError = RecvError
type OneshotReceiverError = RecvError
Type of a
oneshot
receiver error.source§fn spawn<T>(future: T) -> Self::JoinHandle<T::Output>
fn spawn<T>(future: T) -> Self::JoinHandle<T::Output>
Spawn a new task.
source§fn sleep_until(deadline: Self::Instant) -> Self::Sleep
fn sleep_until(deadline: Self::Instant) -> Self::Sleep
Wait until
deadline
is reached.source§fn timeout<R, F: Future<Output = R> + OptionalSend>(
duration: Duration,
future: F
) -> Self::Timeout<R, F>
fn timeout<R, F: Future<Output = R> + OptionalSend>( duration: Duration, future: F ) -> Self::Timeout<R, F>
Require a
Future
to complete before the specified duration has elapsed.source§fn timeout_at<R, F: Future<Output = R> + OptionalSend>(
deadline: Self::Instant,
future: F
) -> Self::Timeout<R, F>
fn timeout_at<R, F: Future<Output = R> + OptionalSend>( deadline: Self::Instant, future: F ) -> Self::Timeout<R, F>
Require a
Future
to complete before the specified instant in time.source§fn thread_rng() -> Self::ThreadLocalRng
fn thread_rng() -> Self::ThreadLocalRng
Get the random number generator to use for generating random numbers. Read more
source§fn oneshot<T>() -> (Self::OneshotSender<T>, Self::OneshotReceiver<T>)where
T: OptionalSend,
fn oneshot<T>() -> (Self::OneshotSender<T>, Self::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
source§impl PartialEq for TokioRuntime
impl PartialEq for TokioRuntime
source§fn eq(&self, other: &TokioRuntime) -> bool
fn eq(&self, other: &TokioRuntime) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for TokioRuntime
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 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