Skip to main content

Driver

Trait Driver 

Source
pub trait Driver {
    // Required method
    fn poll(
        &mut self,
        now: Instant,
        waiter: &Waiter,
    ) -> Result<Option<Instant>, Error>;
}
Expand description

A state machine polled with caller-supplied time.

Each poll advances the driver to now, processes ready work, and registers waiter for external activity. Ok(Some(at)) asks to be polled again by at (or sooner, on a wake); Ok(None) means only external activity can make progress. Err is terminal: the driver has finished and must not be polled again. A clean finish is Error::Closed.

Required Methods§

Source

fn poll( &mut self, now: Instant, waiter: &Waiter, ) -> Result<Option<Instant>, Error>

Advance to now and process ready work.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl Driver for moq_net::Driver

Source§

impl Driver for moq_net::origin::Driver