Struct wayland_client::core::Display
[−]
[src]
pub struct Display { // some fields omitted }
A wayland Display.
This is the connexion to the wayland server, it can be cloned, and the connexion is closed once all clones are destroyed.
Methods
impl Display
fn get_registry(&self) -> Registry
Creates a Registry associated to this Display and returns it.
The registry holds a clone of the Display, and thus will maintain the connexion alive.
The Registry
object is cloneable, and cloning it should be preffered
to calling this method several times (the wayland protocol is not really
designed to have several registries active on the same connexion, and the
destruction of a registry before the end of a connexion is not defined).
fn sync_roundtrip(&self)
Performs a blocking synchronisation of the events of the server.
This call will block until the wayland server has processed all the queries from this Display instance.
fn dispatch_pending(&self)
Dispatches all pending events to their appropriate callbacks.
Does not block if no events are available.
fn dispatch(&self)
Dispatches all pending events to their appropriate callbacks.
If no events are available, blocks until one is received.
fn flush(&self) -> Result<(), IoError>
Send as much requests to the server as possible.
Never blocks, but may not send everything. In which case returns
a WouldBlock
error.
fn sync(&self)
Send a sync
message to the server.
It will then anwser with a done
message. Once the done
message is received,
the callback provided to set_sync_callback
will be called.
As the server processes event sequentially, the callback is thus called once all pending events have been processed.
fn set_sync_callback<F: Fn() + 'static>(&self, f: F)
Sets the callback of a done
event.