pub struct Runtime;Available on crate feature
async-std only.Expand description
Concrete RuntimeLite implementation based on async_std runtime.
Trait Implementations§
Source§impl Clone for AsyncStdRuntime
impl Clone for AsyncStdRuntime
Source§fn clone(&self) -> AsyncStdRuntime
fn clone(&self) -> AsyncStdRuntime
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 AsyncStdRuntime
impl Debug for AsyncStdRuntime
Source§impl Display for AsyncStdRuntime
impl Display for AsyncStdRuntime
Source§impl RuntimeLite for AsyncStdRuntime
impl RuntimeLite for AsyncStdRuntime
Source§type Spawner = AsyncStdSpawner
type Spawner = AsyncStdSpawner
The spawner type for this runtime
Source§type LocalSpawner = AsyncStdSpawner
type LocalSpawner = AsyncStdSpawner
The local spawner type for this runtime
Source§type BlockingSpawner = AsyncStdSpawner
type BlockingSpawner = AsyncStdSpawner
The blocking spawner type for this runtime
Source§type AfterSpawner = AsyncStdSpawner
type AfterSpawner = AsyncStdSpawner
The after spawner type for this runtime
Source§type LocalInterval = Timer
type LocalInterval = Timer
The local interval type for this runtime
Source§type Sleep = AsyncIoSleep
type Sleep = AsyncIoSleep
The sleep type for this runtime
Source§type LocalSleep = AsyncIoSleep
type LocalSleep = AsyncIoSleep
The local sleep type for this runtime
Source§type LocalDelay<F: Future> = Delay<F, AsyncIoSleep>
type LocalDelay<F: Future> = Delay<F, AsyncIoSleep>
The local delay type for this runtime
Source§type LocalTimeout<F: Future> = AsyncIoTimeout<F>
type LocalTimeout<F: Future> = AsyncIoTimeout<F>
The local timeout type for this runtime
Source§fn new() -> AsyncStdRuntime
fn new() -> AsyncStdRuntime
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) -> <AsyncStdRuntime as RuntimeLite>::Interval
fn interval(interval: Duration) -> <AsyncStdRuntime as RuntimeLite>::Interval
Create a new interval that starts at the current time and
yields every
period durationSource§fn interval_at(
start: Instant,
period: Duration,
) -> <AsyncStdRuntime as RuntimeLite>::Interval
fn interval_at( start: Instant, period: Duration, ) -> <AsyncStdRuntime as RuntimeLite>::Interval
Create a new interval that starts at the given instant and
yields every
period durationSource§fn interval_local(
interval: Duration,
) -> <AsyncStdRuntime as RuntimeLite>::LocalInterval
fn interval_local( interval: Duration, ) -> <AsyncStdRuntime as RuntimeLite>::LocalInterval
Create a new interval that starts at the current time and
yields every
period durationSource§fn interval_local_at(
start: Instant,
period: Duration,
) -> <AsyncStdRuntime as RuntimeLite>::LocalInterval
fn interval_local_at( start: Instant, period: Duration, ) -> <AsyncStdRuntime as RuntimeLite>::LocalInterval
Create a new interval that starts at the given instant and
yields every
period durationSource§fn sleep(duration: Duration) -> <AsyncStdRuntime as RuntimeLite>::Sleep
fn sleep(duration: Duration) -> <AsyncStdRuntime as RuntimeLite>::Sleep
Create a new sleep future that completes after the given duration
has elapsed
Source§fn sleep_until(instant: Instant) -> <AsyncStdRuntime as RuntimeLite>::Sleep
fn sleep_until(instant: Instant) -> <AsyncStdRuntime as RuntimeLite>::Sleep
Create a new sleep future that completes at the given instant
has elapsed
Source§fn sleep_local(
duration: Duration,
) -> <AsyncStdRuntime as RuntimeLite>::LocalSleep
fn sleep_local( duration: Duration, ) -> <AsyncStdRuntime as RuntimeLite>::LocalSleep
Create a new sleep future that completes after the given duration
has elapsed
Source§fn sleep_local_until(
instant: Instant,
) -> <AsyncStdRuntime as RuntimeLite>::LocalSleep
fn sleep_local_until( instant: Instant, ) -> <AsyncStdRuntime as RuntimeLite>::LocalSleep
Create a new sleep future that completes at the given instant
has elapsed
Source§fn delay<F>(
duration: Duration,
fut: F,
) -> <AsyncStdRuntime as RuntimeLite>::Delay<F>
fn delay<F>( duration: Duration, fut: F, ) -> <AsyncStdRuntime 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,
) -> <AsyncStdRuntime as RuntimeLite>::LocalDelay<F>where
F: Future,
fn delay_local<F>(
duration: Duration,
fut: F,
) -> <AsyncStdRuntime as RuntimeLite>::LocalDelay<F>where
F: Future,
Source§fn delay_at<F>(
deadline: Instant,
fut: F,
) -> <AsyncStdRuntime as RuntimeLite>::Delay<F>
fn delay_at<F>( deadline: Instant, fut: F, ) -> <AsyncStdRuntime 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: Instant,
fut: F,
) -> <AsyncStdRuntime as RuntimeLite>::LocalDelay<F>where
F: Future,
fn delay_local_at<F>(
deadline: Instant,
fut: F,
) -> <AsyncStdRuntime as RuntimeLite>::LocalDelay<F>where
F: Future,
Source§fn timeout<F>(
duration: Duration,
future: F,
) -> <AsyncStdRuntime as RuntimeLite>::Timeout<F>
fn timeout<F>( duration: Duration, future: F, ) -> <AsyncStdRuntime as RuntimeLite>::Timeout<F>
Requires a
Future to complete before the specified duration has elapsed. Read moreSource§fn timeout_at<F>(
deadline: Instant,
future: F,
) -> <AsyncStdRuntime as RuntimeLite>::Timeout<F>
fn timeout_at<F>( deadline: Instant, future: F, ) -> <AsyncStdRuntime 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,
) -> <AsyncStdRuntime as RuntimeLite>::LocalTimeout<F>where
F: Future,
fn timeout_local<F>(
duration: Duration,
future: F,
) -> <AsyncStdRuntime as RuntimeLite>::LocalTimeout<F>where
F: Future,
Source§fn timeout_local_at<F>(
deadline: Instant,
future: F,
) -> <AsyncStdRuntime as RuntimeLite>::LocalTimeout<F>where
F: Future,
fn timeout_local_at<F>(
deadline: Instant,
future: F,
) -> <AsyncStdRuntime 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 AsyncStdRuntime
Auto Trait Implementations§
impl Freeze for AsyncStdRuntime
impl RefUnwindSafe for AsyncStdRuntime
impl Send for AsyncStdRuntime
impl Sync for AsyncStdRuntime
impl Unpin for AsyncStdRuntime
impl UnwindSafe for AsyncStdRuntime
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