Skip to main content

EventSource

Trait EventSource 

Source
pub trait EventSource {
    // Required methods
    fn read_event(&mut self) -> Result<Event>;
    fn poll_event(&mut self) -> Result<Option<Event>>;
    fn poll_event_timeout(&mut self, timeout: Duration) -> Result<Option<Event>>;
}
Expand description

Blocking and non-blocking reads from one normalized event source.

Required Methods§

Source

fn read_event(&mut self) -> Result<Event>

Blocks until one supported terminal event is available.

Source

fn poll_event(&mut self) -> Result<Option<Event>>

Returns one already-waiting event without blocking.

Source

fn poll_event_timeout(&mut self, timeout: Duration) -> Result<Option<Event>>

Waits up to timeout for one event.

Implementations on Foreign Types§

Source§

impl<T: EventSource + ?Sized> EventSource for &mut T

Implementors§