Skip to main content

RuntimeSupport

Trait RuntimeSupport 

Source
pub trait RuntimeSupport:
    Spawn
    + 'static
    + Sync
    + Send {
    // Required methods
    fn sleep(&self, duration: Duration) -> BoxFuture<'_, ()>;
    fn now(&self) -> Instant;
}
Expand description

A dyn-safe view of the parts of an async runtime that we need for rate-limiting.

Required Methods§

Source

fn sleep(&self, duration: Duration) -> BoxFuture<'_, ()>

Return a future that will yield () after duration has passed.

Source

fn now(&self) -> Instant

Return the current time as an Instant.

Implementors§