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
[src]

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
[src]

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
[src]

impl Send for WlDisplay
[src]

impl Proxy for WlDisplay
[src]

fn ptr(&self) -> *mut wl_proxy

fn interface() -> *mut wl_interface

fn interface_name() -> &'static str

The internal name of this interface, as advertized by the registry if it is a global.

fn version() -> u32

The maximum version of this interface handled by the library.

fn id(&self) -> ProxyId

Get the id of this proxy

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

Creates a proxy from a fresh ptr

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

Creates a proxy from a ptr that is managed elsewhere Read more

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

Set the event iterator associated to this proxy

impl Debug for WlDisplay
[src]

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

Formats the value using the given formatter.

impl Drop for WlDisplay
[src]

fn drop(&mut self)

A method called when the value goes out of scope. Read more