Struct calloop::LoopHandle[][src]

pub struct LoopHandle<Data> { /* fields omitted */ }
Expand description

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.

Implementations

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.

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.

Access this event source

This allows you to modify the event source without removing it from the event loop if it allows it.

Note that replacing it with an other using mem::replace or equivalent would not correctly update its registration and generate errors. Instead you should remove the source using the remove() method and then insert a new one.

Note: This cannot be done from within the callback of the same source.

Enable this previously disabled event source

This previously disabled source will start generating events again.

Note: This cannot be done from within the callback of the same source.

Make this source update its registration

If after accessing the source you changed its parameters in a way that requires updating its registration.

Note: This cannot be done from within the callback of the same source.

Disable this event source

The source remains in the event loop, but it’ll no longer generate events

Note: This cannot be done from within the callback of the same source.

Remove this source from the event loop

You are givent the EventSource back.

Note: This cannot be done from within the callback of the same source.

Remove this event source from the event loop and drop it

The source is not given back to you but instead dropped

Note: This can be done from within the callback of the same source

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.