Trait reactor_trait::Reactor[][src]

pub trait Reactor {
    fn register(
        &self,
        socket: IOHandle
    ) -> Result<Box<dyn AsyncIOHandle + Send>>;
fn sleep<'life0, 'async_trait>(
        &'life0 self,
        dur: Duration
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
fn interval(&self, dur: Duration) -> Box<dyn Stream<Item = Instant>>; }
Expand description

A common interface for registering IO handles in a reactor.

Required methods

Register a synchronous handle, returning an asynchronous one

Sleep for the given duration

Stream that yields at every given interval

Implementors