Trait routing::EventStream [] [src]

pub trait EventStream {
    type Item;
    fn next_ev(&mut self) -> Result<Self::Item, RecvError>;
    fn try_next_ev(&mut self) -> Result<Self::Item, TryRecvError>;
    fn poll(&mut self) -> bool;
}

Trait to fake a channel.

Associated Types

Item produced by this stream.

Required Methods

Read the next available event from the stream, blocking until one becomes available.

Try to read the next available event from the stream without blocking.

Implementations should return an error if there are no items available, OR a real error occurs.

Process events, storing them on the internal buffer.

After calling poll, any events produced will be accessible via next_ev and try_next_ev.

Implementors