Struct wayland_server::LoopToken [] [src]

pub struct LoopToken { /* fields omitted */ }

An event loop token

This token allows some manipulations of the event loop, mainly inserting new event sources in it.

These token are light and clone-able, allowing easy access to these functions without needing to share access to the main EventLoop object.

Methods

impl LoopToken
[src]

[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 implementation 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 implementation 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 implementation whenever the program receives this signal. Calls are made during the dispatching of this event loop.

[src]

Add an idle event source to this event loop

This is a kind of "defer this computation for when there is nothing else to do".

The provided implementation callback will be called when the event loop has finished processing all the pending I/O. This callback will be fired exactly once the first time this condition is met.

You can cancel or retrieve the implementation after it has fired using the returned IdleEventSource.

Trait Implementations

impl Clone for LoopToken
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl !Send for LoopToken

impl !Sync for LoopToken