pub struct Runtime;Available on crate feature
tokio only.Expand description
Concrete RuntimeLite implementation based on tokio runtime.
Trait Implementations§
Source§impl Clone for TokioRuntime
impl Clone for TokioRuntime
Source§fn clone(&self) -> TokioRuntime
fn clone(&self) -> TokioRuntime
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 TokioRuntime
impl Debug for TokioRuntime
Source§impl Display for TokioRuntime
impl Display for TokioRuntime
Source§impl RuntimeLite for TokioRuntime
impl RuntimeLite for TokioRuntime
Source§type Spawner = TokioSpawner
type Spawner = TokioSpawner
The spawner type for this runtime
Source§type LocalSpawner = TokioSpawner
type LocalSpawner = TokioSpawner
The local spawner type for this runtime
Source§type BlockingSpawner = TokioSpawner
type BlockingSpawner = TokioSpawner
The blocking spawner type for this runtime
Source§type AfterSpawner = TokioSpawner
type AfterSpawner = TokioSpawner
The after spawner type for this runtime
Source§type Interval = TokioInterval
type Interval = TokioInterval
The interval type for this runtime
Source§type LocalInterval = TokioInterval
type LocalInterval = TokioInterval
The local interval type for this runtime
Source§type Sleep = TokioSleep
type Sleep = TokioSleep
The sleep type for this runtime
Source§type LocalSleep = TokioSleep
type LocalSleep = TokioSleep
The local sleep type for this runtime
Source§type LocalDelay<F: Future> = Delay<F, TokioSleep>
type LocalDelay<F: Future> = Delay<F, TokioSleep>
The local delay type for this runtime
Source§type LocalTimeout<F: Future> = TokioTimeout<F>
type LocalTimeout<F: Future> = TokioTimeout<F>
The local timeout type for this runtime
Source§fn new() -> TokioRuntime
fn new() -> TokioRuntime
Create a new instance of the runtime
Source§fn block_on<F>(f: F) -> <F as Future>::Outputwhere
F: Future,
fn block_on<F>(f: F) -> <F as Future>::Outputwhere
F: Future,
Block the current thread on the given future
Source§fn interval(interval: Duration) -> <TokioRuntime as RuntimeLite>::Interval
fn interval(interval: Duration) -> <TokioRuntime as RuntimeLite>::Interval
Create a new interval that starts at the current time and
yields every
period durationSource§fn interval_at(
start: <TokioRuntime as RuntimeLite>::Instant,
period: Duration,
) -> <TokioRuntime as RuntimeLite>::Interval
fn interval_at( start: <TokioRuntime as RuntimeLite>::Instant, period: Duration, ) -> <TokioRuntime as RuntimeLite>::Interval
Create a new interval that starts at the given instant and
yields every
period durationSource§fn interval_local(
interval: Duration,
) -> <TokioRuntime as RuntimeLite>::LocalInterval
fn interval_local( interval: Duration, ) -> <TokioRuntime as RuntimeLite>::LocalInterval
Create a new interval that starts at the current time and
yields every
period durationSource§fn interval_local_at(
start: <TokioRuntime as RuntimeLite>::Instant,
period: Duration,
) -> <TokioRuntime as RuntimeLite>::LocalInterval
fn interval_local_at( start: <TokioRuntime as RuntimeLite>::Instant, period: Duration, ) -> <TokioRuntime as RuntimeLite>::LocalInterval
Create a new interval that starts at the given instant and
yields every
period durationSource§fn sleep(duration: Duration) -> <TokioRuntime as RuntimeLite>::Sleep
fn sleep(duration: Duration) -> <TokioRuntime as RuntimeLite>::Sleep
Create a new sleep future that completes after the given duration
has elapsed
Source§fn sleep_until(
instant: <TokioRuntime as RuntimeLite>::Instant,
) -> <TokioRuntime as RuntimeLite>::Sleep
fn sleep_until( instant: <TokioRuntime as RuntimeLite>::Instant, ) -> <TokioRuntime as RuntimeLite>::Sleep
Create a new sleep future that completes at the given instant
has elapsed
Source§fn sleep_local(duration: Duration) -> <TokioRuntime as RuntimeLite>::LocalSleep
fn sleep_local(duration: Duration) -> <TokioRuntime as RuntimeLite>::LocalSleep
Create a new sleep future that completes after the given duration
has elapsed
Source§fn sleep_local_until(
instant: <TokioRuntime as RuntimeLite>::Instant,
) -> <TokioRuntime as RuntimeLite>::LocalSleep
fn sleep_local_until( instant: <TokioRuntime as RuntimeLite>::Instant, ) -> <TokioRuntime as RuntimeLite>::LocalSleep
Create a new sleep future that completes at the given instant
has elapsed
Source§fn delay<F>(
duration: Duration,
fut: F,
) -> <TokioRuntime as RuntimeLite>::Delay<F>
fn delay<F>( duration: Duration, fut: F, ) -> <TokioRuntime as RuntimeLite>::Delay<F>
Create a new delay future that runs the
fut after the given duration
has elapsed. The Future will never be polled until the duration has
elapsed. Read moreSource§fn delay_local<F>(
duration: Duration,
fut: F,
) -> <TokioRuntime as RuntimeLite>::LocalDelay<F>where
F: Future,
fn delay_local<F>(
duration: Duration,
fut: F,
) -> <TokioRuntime as RuntimeLite>::LocalDelay<F>where
F: Future,
Source§fn delay_at<F>(
deadline: <TokioRuntime as RuntimeLite>::Instant,
fut: F,
) -> <TokioRuntime as RuntimeLite>::Delay<F>
fn delay_at<F>( deadline: <TokioRuntime as RuntimeLite>::Instant, fut: F, ) -> <TokioRuntime as RuntimeLite>::Delay<F>
Create a new timeout future that runs the
future after the given deadline.
The Future will never be polled until the deadline has reached. Read moreSource§fn delay_local_at<F>(
deadline: <TokioRuntime as RuntimeLite>::Instant,
fut: F,
) -> <TokioRuntime as RuntimeLite>::LocalDelay<F>where
F: Future,
fn delay_local_at<F>(
deadline: <TokioRuntime as RuntimeLite>::Instant,
fut: F,
) -> <TokioRuntime as RuntimeLite>::LocalDelay<F>where
F: Future,
Source§fn timeout<F>(
timeout: Duration,
fut: F,
) -> <TokioRuntime as RuntimeLite>::Timeout<F>
fn timeout<F>( timeout: Duration, fut: F, ) -> <TokioRuntime as RuntimeLite>::Timeout<F>
Requires a
Future to complete before the specified duration has elapsed. Read moreSource§fn timeout_at<F>(
deadline: <TokioRuntime as RuntimeLite>::Instant,
future: F,
) -> <TokioRuntime as RuntimeLite>::Timeout<F>
fn timeout_at<F>( deadline: <TokioRuntime as RuntimeLite>::Instant, future: F, ) -> <TokioRuntime as RuntimeLite>::Timeout<F>
Requires a
Future to complete before the specified instant in time. Read moreSource§fn timeout_local<F>(
duration: Duration,
future: F,
) -> <TokioRuntime as RuntimeLite>::LocalTimeout<F>where
F: Future,
fn timeout_local<F>(
duration: Duration,
future: F,
) -> <TokioRuntime as RuntimeLite>::LocalTimeout<F>where
F: Future,
Source§fn timeout_local_at<F>(
deadline: <TokioRuntime as RuntimeLite>::Instant,
future: F,
) -> <TokioRuntime as RuntimeLite>::LocalTimeout<F>where
F: Future,
fn timeout_local_at<F>(
deadline: <TokioRuntime as RuntimeLite>::Instant,
future: F,
) -> <TokioRuntime as RuntimeLite>::LocalTimeout<F>where
F: Future,
Like
timeout_at, but does not requrie the future to be Send.
Requires a Future to complete before the specified duration has elapsed. Read moreSource§fn spawn<F>(
future: F,
) -> <Self::Spawner as AsyncSpawner>::JoinHandle<<F as Future>::Output>
fn spawn<F>( future: F, ) -> <Self::Spawner as AsyncSpawner>::JoinHandle<<F as Future>::Output>
Spawn a future onto the runtime
Source§fn spawn_detach<F>(future: F)
fn spawn_detach<F>(future: F)
Spawn a future onto the runtime and detach it
Source§fn spawn_local<F>(
future: F,
) -> <Self::LocalSpawner as AsyncLocalSpawner>::JoinHandle<<F as Future>::Output>
fn spawn_local<F>( future: F, ) -> <Self::LocalSpawner as AsyncLocalSpawner>::JoinHandle<<F as Future>::Output>
Spawn a future onto the local runtime
Source§fn spawn_local_detach<F>(future: F)
fn spawn_local_detach<F>(future: F)
Spawn a future onto the local runtime and detach it
Source§fn spawn_blocking<F, R>(
f: F,
) -> <Self::BlockingSpawner as AsyncBlockingSpawner>::JoinHandle<R>
fn spawn_blocking<F, R>( f: F, ) -> <Self::BlockingSpawner as AsyncBlockingSpawner>::JoinHandle<R>
Spawn a blocking function onto the runtime
Source§fn spawn_blocking_detach<F, R>(f: F)
fn spawn_blocking_detach<F, R>(f: F)
Spawn a blocking function onto the runtime and detach it
Source§fn spawn_after<F>(
duration: Duration,
future: F,
) -> <Self::AfterSpawner as AsyncAfterSpawner>::JoinHandle<<F as Future>::Output>
fn spawn_after<F>( duration: Duration, future: F, ) -> <Self::AfterSpawner as AsyncAfterSpawner>::JoinHandle<<F as Future>::Output>
Spawn a future onto the runtime and run the given future after the given duration
Source§fn spawn_after_at<F>(
at: Self::Instant,
future: F,
) -> <Self::AfterSpawner as AsyncAfterSpawner>::JoinHandle<<F as Future>::Output>
fn spawn_after_at<F>( at: Self::Instant, future: F, ) -> <Self::AfterSpawner as AsyncAfterSpawner>::JoinHandle<<F as Future>::Output>
Spawn a future onto the runtime and run the given future after the given instant.
impl Copy 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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