[][src]Struct calloop::LoopHandle

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]

pub fn insert_source<E: EventSource, F: FnMut(E::Event, &mut Data) + 'static>(
    &self,
    source: E,
    callback: F
) -> Result<Source<E>, InsertError<E>>
[src]

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]

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]

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> !Sync for LoopHandle<Data>

Blanket Implementations

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]