Struct wayland_client::Connection [−][src]
pub struct Connection { /* fields omitted */ }
Expand description
The Wayland connection
This is the main type representing your connection to the Wayland server. Most operations require
access to either this type or the ConnectionHandle
, which can be accessed through the
handle()
method, and is given to you in most callbacks.
Implementations
Access the connection handle
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
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)
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Connection
impl Send for Connection
impl Sync for Connection
impl Unpin for Connection
impl UnwindSafe for Connection
Blanket Implementations
Mutably borrows from an owned value. Read more
impl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any,
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
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
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
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
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