Struct calloop::LoopHandle [−][src]
pub struct LoopHandle<Data> { /* fields omitted */ }
An handle to an event loop
This handle allows you to insert new sources and idles in this event loop, it can be cloned, and it is possible to insert new sources from within a source callback.
Methods
impl<Data: 'static> LoopHandle<Data>
[src]
impl<Data: 'static> LoopHandle<Data>
pub fn insert_source<E: EventSource, F: FnMut(E::Event, &mut Data) + 'static>(
&self,
source: E,
callback: F
) -> Result<Source<E>>
[src]
pub fn insert_source<E: EventSource, F: FnMut(E::Event, &mut Data) + 'static>(
&self,
source: E,
callback: F
) -> Result<Source<E>>
Insert an new event source in the loop
The provided callback will be called during the dispatching cycles whenever the
associated source generates events, see EventLoop::dispatch(..)
for details.
pub fn insert_idle<F: FnOnce(&mut Data) + 'static>(&self, callback: F) -> Idle
[src]
pub fn insert_idle<F: FnOnce(&mut Data) + 'static>(&self, callback: F) -> Idle
Insert an idle callback
This callback will be called during a dispatching cycle when the event loop has finished processing all pending events from the sources and becomes idle.
Trait Implementations
impl<Data> Clone for LoopHandle<Data>
[src]
impl<Data> Clone for LoopHandle<Data>
fn clone(&self) -> LoopHandle<Data>
[src]
fn clone(&self) -> LoopHandle<Data>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl<Data> !Send for LoopHandle<Data>
impl<Data> !Send for LoopHandle<Data>
impl<Data> !Sync for LoopHandle<Data>
impl<Data> !Sync for LoopHandle<Data>