pub struct AsyncStdRuntime;
Available on crate feature async-std only.
Expand description

Concrete RuntimeLite implementation based on async_std runtime.

Trait Implementations§

source§

impl Clone for AsyncStdRuntime

source§

fn clone(&self) -> AsyncStdRuntime

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for AsyncStdRuntime

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for AsyncStdRuntime

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl RuntimeLite for AsyncStdRuntime

§

type Spawner = AsyncStdSpawner

The spawner type for this runtime
§

type LocalSpawner = AsyncStdSpawner

The local spawner type for this runtime
§

type BlockingSpawner = AsyncStdSpawner

The blocking spawner type for this runtime
§

type AfterSpawner = AsyncStdSpawner

Available on crate feature time only.
The after spawner type for this runtime
§

type LocalAfterSpawner = AsyncStdSpawner

Available on crate feature time only.
The local after spawner type for this runtime
§

type Interval = Timer

Available on crate feature time only.
The interval type for this runtime
§

type LocalInterval = Timer

Available on crate feature time only.
The local interval type for this runtime
§

type Sleep = AsyncIoSleep

Available on crate feature time only.
The sleep type for this runtime
§

type LocalSleep = AsyncIoSleep

Available on crate feature time only.
The local sleep type for this runtime
§

type Delay<F> = Delay<F, AsyncIoSleep> where F: Future + Send

Available on crate feature time only.
The delay type for this runtime
§

type LocalDelay<F> = Delay<F, AsyncIoSleep> where F: Future

Available on crate feature time only.
The local delay type for this runtime
§

type Timeout<F> = AsyncIoTimeout<F> where F: Future + Send

Available on crate feature time only.
The timeout type for this runtime
§

type LocalTimeout<F> = AsyncIoTimeout<F> where F: Future

Available on crate feature time only.
The local timeout type for this runtime
source§

fn new() -> Self

Create a new instance of the runtime
source§

fn block_on<F: Future>(f: F) -> F::Output

Block the current thread on the given future
source§

fn interval(interval: Duration) -> Self::Interval

Available on crate feature time only.
Create a new interval that starts at the current time and yields every period duration
source§

fn interval_at(start: Instant, period: Duration) -> Self::Interval

Available on crate feature time only.
Create a new interval that starts at the given instant and yields every period duration
source§

fn interval_local(interval: Duration) -> Self::LocalInterval

Available on crate feature time only.
Create a new interval that starts at the current time and yields every period duration
source§

fn interval_local_at(start: Instant, period: Duration) -> Self::LocalInterval

Available on crate feature time only.
Create a new interval that starts at the given instant and yields every period duration
source§

fn sleep(duration: Duration) -> Self::Sleep

Available on crate feature time only.
Create a new sleep future that completes after the given duration has elapsed
source§

fn sleep_until(instant: Instant) -> Self::Sleep

Available on crate feature time only.
Create a new sleep future that completes at the given instant has elapsed
source§

fn sleep_local(duration: Duration) -> Self::LocalSleep

Available on crate feature time only.
Create a new sleep future that completes after the given duration has elapsed
source§

fn sleep_local_until(instant: Instant) -> Self::LocalSleep

Available on crate feature time only.
Create a new sleep future that completes at the given instant has elapsed
source§

async fn yield_now()

Yield the current task
source§

fn delay<F>(duration: Duration, fut: F) -> Self::Delay<F>
where F: Future + Send,

Available on crate feature time only.
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 more
source§

fn delay_local<F>(duration: Duration, fut: F) -> Self::LocalDelay<F>
where F: Future,

Available on crate feature time only.
Like delay, but does not require the fut to be Send. 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 more
source§

fn delay_at<F>(deadline: Instant, fut: F) -> Self::Delay<F>
where F: Future + Send,

Available on crate feature time only.
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 more
source§

fn delay_local_at<F>(deadline: Instant, fut: F) -> Self::LocalDelay<F>
where F: Future,

Available on crate feature time only.
Like delay_at, but does not require the fut to be Send. 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 more
source§

fn spawn<F>(future: F) -> <Self::Spawner as AsyncSpawner>::JoinHandle<F::Output>
where F::Output: Send + 'static, F: Future + Send + 'static, <<Self::Spawner as AsyncSpawner>::JoinHandle<F> as Future>::Output: Send,

Spawn a future onto the runtime
source§

fn spawn_detach<F>(future: F)
where F::Output: Send + 'static, F: Future + Send + 'static,

Spawn a future onto the runtime and detach it
source§

fn spawn_local<F>( future: F ) -> <Self::LocalSpawner as AsyncLocalSpawner>::JoinHandle<F::Output>
where F: Future + 'static, F::Output: 'static,

Spawn a future onto the local runtime
source§

fn spawn_local_detach<F>(future: F)
where F: Future + 'static, F::Output: 'static,

Spawn a future onto the local runtime and detach it
source§

fn spawn_blocking<F, R>( f: F ) -> <Self::BlockingSpawner as AsyncBlockingSpawner>::JoinHandle<R>
where F: FnOnce() -> R + Send + 'static, R: Send + 'static,

Spawn a blocking function onto the runtime
source§

fn spawn_blocking_detach<F, R>(f: F)
where F: FnOnce() -> R + Send + 'static, R: Send + 'static,

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::Output>
where F::Output: Send + 'static, F: Future + Send + 'static,

Available on crate feature time only.
Spawn a future onto the runtime and run the given future after the given duration
source§

fn spawn_after_at<F>( at: Instant, future: F ) -> <Self::AfterSpawner as AsyncAfterSpawner>::JoinHandle<F::Output>
where F::Output: Send + 'static, F: Future + Send + 'static,

Available on crate feature time only.
Spawn a future onto the runtime and run the given future after the given instant.
source§

fn spawn_local_after<F>( duration: Duration, future: F ) -> <Self::LocalAfterSpawner as AsyncLocalAfterSpawner>::JoinHandle<F::Output>
where F::Output: Send + 'static, F: Future + Send + 'static,

Available on crate feature time only.
Like spawn_after, but does not require the future to be Send. Read more
source§

fn spawn_local_after_at<F>( at: Instant, future: F ) -> <Self::LocalAfterSpawner as AsyncLocalAfterSpawner>::JoinHandle<F::Output>
where F::Output: Send + 'static, F: Future + Send + 'static,

Available on crate feature time only.
Like spawn_after_at, but does not require the future to be Send. Read more
source§

fn timeout<F>(duration: Duration, future: F) -> Self::Timeout<F>
where F: Future + Send,

Available on crate feature time only.
Requires a Future to complete before the specified duration has elapsed. Read more
source§

fn timeout_at<F>(deadline: Instant, future: F) -> Self::Timeout<F>
where F: Future + Send,

Available on crate feature time only.
Requires a Future to complete before the specified instant in time. Read more
source§

fn timeout_local<F>(duration: Duration, future: F) -> Self::LocalTimeout<F>
where F: Future,

Available on crate feature time only.
Like timeout, but does not requrie the future to be Send. Requires a Future to complete before the specified duration has elapsed. Read more
source§

fn timeout_local_at<F>(deadline: Instant, future: F) -> Self::LocalTimeout<F>
where F: Future,

Available on crate feature time only.
Like timeout_at, but does not requrie the future to be Send. Requires a Future to complete before the specified duration has elapsed. Read more
source§

impl Copy for AsyncStdRuntime

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more