[][src]Trait simulation::Environment

pub trait Environment: Unpin + Sized + Clone + Send {
    fn spawn<F>(&self, future: F)
    where
        F: Future<Output = ()> + Send + 'static
;
fn now(&self) -> Instant;
fn delay(&self, deadline: Instant) -> Delay;
fn timeout<T>(&self, value: T, timeout: Duration) -> Timeout<T>; fn delay_from(&self, from_now: Duration) -> Delay { ... } }

Required methods

fn spawn<F>(&self, future: F) where
    F: Future<Output = ()> + Send + 'static, 

fn now(&self) -> Instant

Return the time now according to the executor.

fn delay(&self, deadline: Instant) -> Delay

Returns a delay future which completes after the provided instant.

fn timeout<T>(&self, value: T, timeout: Duration) -> Timeout<T>

Creates a timeout future which will execute blah blah

Loading content...

Provided methods

fn delay_from(&self, from_now: Duration) -> Delay

Returns a delay future which completes at some time from now.

Loading content...

Implementors

impl Environment for DeterministicRuntimeHandle[src]

impl Environment for SingleThreadedRuntimeHandle[src]

Loading content...