Struct calloop::EventLoop [−][src]
pub struct EventLoop { /* fields omitted */ }An event loop
This loop can host several event sources, that can be dynamically added or removed.
Methods
impl EventLoop[src]
impl EventLooppub fn new() -> Result<EventLoop>[src]
pub fn new() -> Result<EventLoop>Create a new event loop
It is backed by an mio provided machinnery, and will fail if the mio
initialization fails.
pub fn handle(&self) -> LoopHandle[src]
pub fn handle(&self) -> LoopHandleRetrieve a loop handle
pub fn dispatch(&mut self, timeout: Option<Duration>) -> Result<()>[src]
pub fn dispatch(&mut self, timeout: Option<Duration>) -> Result<()>Dispatch pending events to their callbacks
Some source have events available, their callbacks will be immediatly called.
Otherwise this will wait until an event is receive or the provided timeout
is reached. If timeout is None, it will wait without a duration limit.
Once pending events have been processed or the timeout is reached, all pending idle callbacks will be fired before this method returns.