Runtime

Struct Runtime 

Source
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

Source§

fn clone(&self) -> TokioRuntime

Returns a duplicate 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 TokioRuntime

Source§

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

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

impl Display for TokioRuntime

Source§

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

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

impl RuntimeLite for TokioRuntime

Source§

type Spawner = TokioSpawner

The spawner type for this runtime
Source§

type LocalSpawner = TokioSpawner

The local spawner type for this runtime
Source§

type BlockingSpawner = TokioSpawner

The blocking spawner type for this runtime
Source§

type Instant = Instant

The instant type for this runtime
Source§

type AfterSpawner = TokioSpawner

The after spawner type for this runtime
Source§

type Interval = TokioInterval

The interval type for this runtime
Source§

type LocalInterval = TokioInterval

The local interval type for this runtime
Source§

type Sleep = TokioSleep

The sleep type for this runtime
Source§

type LocalSleep = TokioSleep

The local sleep type for this runtime
Source§

type Delay<F: Future + Send> = Delay<F, TokioSleep>

The delay type for this runtime
Source§

type LocalDelay<F: Future> = Delay<F, TokioSleep>

The local delay type for this runtime
Source§

type Timeout<F: Future + Send> = TokioTimeout<F>

The timeout type for this runtime
Source§

type LocalTimeout<F: Future> = TokioTimeout<F>

The local timeout type for this runtime
Source§

fn new() -> TokioRuntime

Create a new instance of the runtime
Source§

fn name() -> &'static str

Returns the name of the runtime Read more
Source§

fn fqname() -> &'static str

Returns the fully qualified name of the runtime Read more
Source§

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

Block the current thread on the given future
Source§

async fn yield_now()

Yield the current task
Source§

fn interval(interval: Duration) -> <TokioRuntime as RuntimeLite>::Interval

Create a new interval that starts at the current time and yields every period duration
Source§

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 duration
Source§

fn interval_local( interval: Duration, ) -> <TokioRuntime as RuntimeLite>::LocalInterval

Create a new interval that starts at the current time and yields every period duration
Source§

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 duration
Source§

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

Create a new sleep future that completes at the given instant has elapsed
Source§

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

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>
where F: Future + 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_local<F>( duration: Duration, fut: F, ) -> <TokioRuntime as RuntimeLite>::LocalDelay<F>
where F: Future,

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: <TokioRuntime as RuntimeLite>::Instant, fut: F, ) -> <TokioRuntime as RuntimeLite>::Delay<F>
where F: Future + 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 delay_local_at<F>( deadline: <TokioRuntime as RuntimeLite>::Instant, fut: F, ) -> <TokioRuntime as RuntimeLite>::LocalDelay<F>
where F: Future,

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 timeout<F>( timeout: Duration, fut: F, ) -> <TokioRuntime as RuntimeLite>::Timeout<F>
where F: Future + Send,

Requires a Future to complete before the specified duration has elapsed. Read more
Source§

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

Requires a Future to complete before the specified instant in time. Read more
Source§

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

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: <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 more
Source§

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

Spawn a future onto the runtime
Source§

fn spawn_detach<F>(future: F)
where <F as Future>::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 as Future>::Output>
where F: Future + 'static, <F as Future>::Output: 'static,

Spawn a future onto the local runtime
Source§

fn spawn_local_detach<F>(future: F)
where F: Future + 'static, <F as Future>::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 now() -> Self::Instant

Returns an instant corresponding to “now”.
Source§

fn spawn_after<F>( duration: Duration, future: F, ) -> <Self::AfterSpawner as AsyncAfterSpawner>::JoinHandle<<F as Future>::Output>
where <F as Future>::Output: Send + 'static, F: Future + Send + 'static,

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

Spawn a future onto the runtime and run the given future after the given instant.
Source§

impl Copy for TokioRuntime

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

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

Source§

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> ToSmolStr for T
where T: Display + ?Sized,

Source§

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

Source§

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>,

Source§

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>,

Source§

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