Struct wayland_client::Display[][src]

pub struct Display { /* fields omitted */ }

A connection to a wayland server

This object both represent the connection to the server, and as such must be kept alive as long as you are connected, and contains the primary WlDisplay wayland object, from which you can create all your need objects. The inner Proxy<WlDisplay> can be accessed via Deref.

Methods

impl Display
[src]

Attempt to connect to a wayland server using the contents of the environment variables

First of all, if the WAYLAND_SOCKET environment variable is set, it'll try to interpret it as a FD number to use

If the WAYLAND_DISPLAY variable is set, it will try to connect to the socket it points to. Otherwise, it will default to wayland-0.

On success, you are given the Display object as well as the main EventQueue hosting the WlDisplay wayland object.

This requires the XDG_RUNTIME_DIR variable to be properly set.

Attempt to connect to a wayland server socket with given name

On success, you are given the Display object as well as the main EventQueue hosting the WlDisplay wayland object.

This requires the XDG_RUNTIME_DIR variable to be properly set.

Attempt to use an already connected unix socket on given FD to start a wayland connection

On success, you are given the Display object as well as the main EventQueue hosting the WlDisplay wayland object.

Will take ownership of the FD.

Non-blocking write to the server

Outgoing messages to the server are buffered by the library for efficiency. This method flushes the internal buffer to the server socket.

Will write as many pending requests as possible to the server socket. Never blocks: if not all requests coul be written, will return an io error WouldBlock.

On success returns the number of written requests.

Create a new event queue associated with this wayland connection

Methods from Deref<Target = Proxy<WlDisplay>>

Send a request through this object

This is the generic method to send requests.

Several requests require the creation of new objects using the child() method, which if done wrong can cause protocol errors (in which case the server will terminate your connexion). Thus unless your know exactly what you are doing, you should use the helper methods provided by the various RequestsTrait for each interface, which handle this correctly for you.

Check if the object associated with this proxy is still alive

Will return false if either:

  • The object has been destroyed
  • The object is not managed by this library (see the from_c_ptr method)

Retrieve the interface version of this wayland object instance

Returns 0 on dead objects

Retrieve the object id of this wayland object

Associate an arbitrary payload to this object

The pointer you associate here can be retrieved from any other proxy to the same wayland object.

Setting or getting user data is done as an atomic operation. You are responsible for the correct initialization of this pointer, synchronisation of access, and destruction of the contents at the appropriate time.

Retrieve the arbitrary payload associated to this object

See set_user_data for explanations.

Check if the other proxy refers to the same underlying wayland object

Create a new child object

This creates a new wayland object, considered as a child of this object. It will notably inherit its interface version.

The created object should immediatly be implemented and sent in a request to the server, to keep the object list properly synchronized. Failure to do so will likely cause a protocol error.

Creates a handle of this proxy with its actual type erased

Check whether this proxy has been implemented with given type

Always returns false if the proxy is no longer alive

Trait Implementations

impl Deref for Display
[src]

The resulting type after dereferencing.

Dereferences the value.

Auto Trait Implementations

impl Send for Display

impl Sync for Display