Struct wayland_server::EventLoop [] [src]

pub struct EventLoop { /* fields omitted */ }

An event loop

This is an event loop primitive provided by the wayland C libraries. It is notably used for processing messages from the different clients of your server, but additionnal event sources can be associated to it.

You can also create other event loops (for a multithreaded server for example), however the wayland clients can only be processed from the original event loop created at the same time as the display.

The event loops cannot be moved accross threads, so make sure you create them on the thread you want to use them.

Methods

impl EventLoop
[src]

[src]

Create a new event loop

[src]

Retrieve a LoopToken associated to this event loop

[src]

Retrieve a LoopSignal associated to this event loop

[src]

Dispatch pending requests to their respective handlers

If no request is pending, will block at most timeout ms if specified, or indefinitely if timeout is None.

Returns the number of requests dispatched or an error.

[src]

Runs the event loop

This method will call repetitively the dispatch method, until one of the handlers call the stop method of an associated LoopSignal.

If this event loop is attached to a display, it will also flush the events to the clients between two calls to dispatch().

Note that this method will block indefinitely on waiting events, as such, if you need to avoid a complete block even if no events are received, you should use the dispatch() method instead and set a timeout.

Trait Implementations

Auto Trait Implementations

impl !Send for EventLoop

impl !Sync for EventLoop