Struct wayland_client::wayland::WlDisplay [] [src]

pub struct WlDisplay {
    // some fields omitted
}

core global object

The core global object. This is a special singleton object. It is used for internal Wayland protocol features.

Methods

impl WlDisplay

fn sync(&self) -> WlCallback

asynchronous roundtrip

The sync request asks the server to emit the 'done' event on the returned wl_callback object. Since requests are handled in-order and events are delivered in-order, this can be used as a barrier to ensure all previous requests and the resulting events have been handled.

The object returned by this request will be destroyed by the compositor after the callback is fired and as such the client must not attempt to use it after that point.

The callback_data passed in the callback is the event serial.

fn get_registry(&self) -> WlRegistry

get global registry object

This request creates a registry object that allows the client to list and bind the global objects available from the compositor.

impl WlDisplay

fn sync_roundtrip(&mut self) -> Result<i32>

Synchronous roundtrip

This call will cause a synchonous roundtrip with the wayland server. I will block until all pending requests are send to the server and it has processed all of them and send the appropriate events.

On success returns the number of dispatched events.

fn dispatch(&mut self) -> Result<i32>

Blocking dispatch

Will dispatch all pending events from the internal buffer to the events iterators. If the buffer was empty, will read new events from the server socket, blocking if necessary.

On success returns the number of dispatched events.

fn dispatch_pending(&self) -> Result<i32>

Non-blocking dispatch

Will dispatch all pending events from the internal buffer to the events iterators. Will not try to read events from the server socket, hence never blocks.

On success returns the number of dispatched events.

fn prepare_read(&self) -> Option<ReadEventsGuard>

Prepare an conccurent read

Will declare your intention to read events from the server socket. Contrarily to dispatch() or sync_roundtrip(), this method can be called several times conccurently.

Will return None if there are still some events awaiting dispatch. In this case, you need to call dispatch_pending() before calling this method again.

As long as the returned guard is in scope, no events can be dispatched to any event iterator.

The guard can then be destroyed by two means:

  • Calling its cancel() method (or letting it go out of scope): the read intention will be cancelled
  • Calling its read_events() method: will block until all existing guards are destroyed by one of these methods, then events will be read and all blocked read_events() calls will return.

This call will otherwise not block on the server socket if it is empty, and return an io error WouldBlock in such cases.

fn flush(&self) -> Result<i32>

Non-blocking write to the server

Will write as many 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.

Trait Implementations

impl Sync for WlDisplay

impl Send for WlDisplay

impl Proxy for WlDisplay

fn ptr(&self) -> *mut wl_proxy

fn interface() -> *mut wl_interface

fn interface_name() -> &'static str

fn version() -> u32

fn id(&self) -> ProxyId

unsafe fn from_ptr(ptr: *mut wl_proxy) -> WlDisplay

unsafe fn from_ptr_no_own(ptr: *mut wl_proxy) -> WlDisplay

fn set_evt_iterator(&mut self, evt: &EventIterator)

impl Debug for WlDisplay

fn fmt(&self, fmt: &mut Formatter) -> Result<(), Error>

impl Drop for WlDisplay

fn drop(&mut self)