Struct calloop::LoopHandle[][src]

pub struct LoopHandle<'l, 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

Inserts a 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.

This function takes ownership of the event source. Use register_dispatcher if you need access to the event source after this call.

Registers a Dispatcher in the loop.

Use this function if you need access to the event source after its insertion in the loop.

See also insert_source.

Inserts 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.

Enables 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.

Makes 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.

Disables 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.

Removes this source from the event loop.

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

Removes this source from the event loop.

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

Wrap an IO object into an async adapter

This adapter turns the IO object into an async-aware one that can be used in futures. The readiness of these futures will be driven by the event loop.

The produced futures can be polled in any executor, and notably the one provided by calloop.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. 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.