pub struct Connection { /* private fields */ }
Expand description

The Wayland connection

This is the main type representing your connection to the Wayland server.

Implementations

Try to connect to the Wayland server following the environment

This is the standard way to initialize a Wayland connection.

Initialize a Wayland connection from an already existing Unix stream

Wrap an existing Backend into a Connection

Get the Backend underlying this Connection

Flush pending outgoing events to the server

This needs to be done regularly to ensure the server receives all your requests.

Start a synchronized read from the socket

This is needed if you plan to wait on readiness of the Wayland socket using an event loop. See ReadEventsGuard for details. Once the events are received, you’ll then need to dispatch them from the event queue using EventQueue::dispatch_pending().

If you don’t need to manage multiple event sources, see blocking_dispatch() for a simpler mechanism.

Block until events are received from the server

This will flush the outgoing socket, and then block until events are received from the server and read them. You’ll then need to invoke EventQueue::dispatch_pending() to dispatch them on their respective event queues. Alternatively, EventQueue::blocking_dispatch() does both.

Do a roundtrip to the server

This method will block until the Wayland server has processed and answered all your preceding requests. This is notably useful during the initial setup of an app, to wait for the initial state from the server.

Create a new event queue

Retrive the protocol error that occured on the socket (if any)

Get the WlDisplay associated with this connection

Send a request associated with the provided object

This is a low-level interface for sending requests, you will likely instead use the methods of the types representing each interface.

Create a null id for request serialization

This is a low-level interface for sending requests, you don’t need to use it if you are using the methods of the types representing each interface.

Get the object data for a given object ID

This is a low-level interface, a higher-level interface for manipulating object data is given as Proxy::data().

Get the protocol information related to given object ID

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait. Read more

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait. Read more

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s. Read more

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s. Read more

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.