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
type Item
Item produced by this stream.
Required Methods
fn next_ev(&mut self) -> Result<Self::Item, RecvError>
Read the next available event from the stream, blocking until one becomes available.
fn try_next_ev(&mut self) -> Result<Self::Item, TryRecvError>
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.
fn poll(&mut self) -> bool
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
impl<S> EventStream for S where
S: EventStepper,