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]
pub fn add_fd_event_source<Impl>(
&self,
fd: RawFd,
interest: FdInterest,
implementation: Impl
) -> Result<Source<FdEvent>, (IoError, Impl)> where
Impl: Implementation<(), FdEvent> + 'static,
[src]
&self,
fd: RawFd,
interest: FdInterest,
implementation: Impl
) -> Result<Source<FdEvent>, (IoError, Impl)> where
Impl: Implementation<(), FdEvent> + 'static,
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.
pub fn add_timer_event_source<Impl>(
&self,
implementation: Impl
) -> Result<Source<TimerEvent>, (IoError, Impl)> where
Impl: Implementation<(), TimerEvent> + 'static,
[src]
&self,
implementation: Impl
) -> Result<Source<TimerEvent>, (IoError, Impl)> where
Impl: Implementation<(), TimerEvent> + 'static,
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.
pub fn add_signal_event_source<Impl>(
&self,
signal: Signal,
implementation: Impl
) -> Result<Source<SignalEvent>, (IoError, Impl)> where
Impl: Implementation<(), SignalEvent> + 'static,
[src]
&self,
signal: Signal,
implementation: Impl
) -> Result<Source<SignalEvent>, (IoError, Impl)> where
Impl: Implementation<(), SignalEvent> + 'static,
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.
pub fn add_idle_event_source<Impl>(&self, implementation: Impl) -> IdleSource where
Impl: Implementation<(), ()> + 'static,
[src]
Impl: Implementation<(), ()> + 'static,
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
.