Struct wayland_server::EventLoopHandle [] [src]

pub struct EventLoopHandle { /* fields omitted */ }

Handle to an event loop

This handle gives you access to methods on an event loop that are safe to do from within a callback.

They are also available on an EventLoop object via Deref.

Methods

impl EventLoopHandle
[src]

[src]

Register a resource to this event loop.

You are required to provide a valid implementation for this proxy as well as some associated implementation data. This implementation is expected to be a struct holding the various relevant function pointers.

This implementation data can typically contain indexes to state value that the implementation will need to work on.

If you provide a destructor function, it will be called whenever the resource is destroyed, be it at the client request or because the associated client was disconnected. You'd typically use this to cleanup resources

This overwrites any precedently set implementation for this proxy.

Returns appropriately and does nothing if this proxy is dead or already managed by something else than this library.

[src]

Stop looping

If the event loop this handle belongs to is currently running its run() method, it'll stop and return as soon as the current dispatching session ends.

[src]

Get an handle to the internal state

The returned guard object allows you to get references to the handler objects you previously inserted in this event loop.

[src]

Add a File Descriptor event source to this event loop

The interest in read/write capability for this FD must be provided (and can be changed afterwards using the returned object), and the associated handler will be called whenever these capabilities are satisfied, during the dispatching of this event loop.

[src]

Add a timer event source to this event loop

It is a countdown, which can be reset using the struct returned by this function. When the countdown reaches 0, the registered handler is called in the dispatching of this event loop.

[src]

Add a signal event source to this event loop

This will listen for a given unix signal (by setting up a signalfd for it) and call the registered handler whenever the program receives this signal. Calls are made during the dispatching of this event loop.