Module smithay::utils::signaling[][src]

Expand description

A general purpose signaling mechanism

This mechanism allows inter-module communication, by letting your modules register callbacks to listen for events generated by other modules. This signaling mechanism is synchronous and non-thread safe. If you need asynchronous thread safe communication, instead consider relying on channels.

The whole mechanism is built on the Signaler type. It serves both as a message sending facility and a way to register new callbacks for these messages. It can be cloned and passed around between your modules with Rc-like semantics.

When sending a new signal with Signaler::signal, the provided value E will be made accessible as a reference &E to all registered callback.

Sending a signal or registering a new callback from within a callback is supported. These will however take effect after the current signal is completely delivered. Ordering of sent signals and callback registration is preserved.

Structs

A token associated with a callback registered to a Signaler

A signaler, main type for signaling

Traits

Trait representing the capability of an object to listen for some signals