pub struct WaylandSource { /* private fields */ }
Expand description

An adapter to insert a Wayland EventQueue into a calloop event loop

This is a struct that implements calloop::EventSource. It generates an event whenever events need to be dispatched. At this point your calloop callback will be given access to the EventQueue and you should call .dispatch_pending() and forward its return value, allowing you to handle orphan events as you prefer.

If you don’t use orphan events, the quick_insert method will directly insert the source into a provided LoopHandle with an adapter which will panic whenever an oprhan event is encountered.

Implementations

Wrap an EventQueue as a WaylandSource.

Insert this source into given event loop with an adapter that panics on orphan events

The adapter will pass the event loop’s global shared data as dispatch_data too all callbacks.

Access the underlying event queue

This method can be used if you need to access the underlying EventQueue while this WaylandSource is currently inserted in an event loop.

Note that you should be careful when interacting with it if you invoke methods that interact with the wayland socket (such as dispatch() or prepare_read()). These may interefere with the proper waking up of this event source in the event loop.

Trait Implementations

Formats the value using the given formatter. Read more

The type of events generated by your source.

Some metadata of your event source Read more

The return type of the user callback Read more

Process any relevant events Read more

Register yourself to this poll instance Read more

Re-register your file descriptors Read more

Unregister your file descriptors Read more

Notification that a polling session is going to start Read more

Notification that the current polling session ended 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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

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.