Crate wayland_backend
source · [−]Expand description
Backend API for wayland crates
This crate provide low-level APIs for interacting with the Wayland protocol, both client-side and server-side.
Two possible backends are provided by this crate: the system backend (sys module)
which relies on the system-provided wayland libraries, and the rust backend (rs module)
which is an alternative rust implementation of the protocol. The rust backend is always
available, and the system backend is controlled by the client_system and server_system
cargo features. The dlopen cargo feature ensures that the system wayland
libraries are loaded dynamically at runtime, so that your executable does not link them and
can gracefully handle their absence (for example by falling back to X11).
Additionally the default backends are reexported as toplevel client and server modules
in this crate. For both client and server, the default backend is the system one if the
associated cargo feature is enabled, and the rust one otherwise.
Using these reexports is the recommended way to use the crate:
- If you don’t need the
*_systemfeatures, an other crate enabling them will not impact your code in any way as both backends have the same API (the system backend only has more methods) - If your code needs to do FFI, you just need to directly depend on
wayland-backendwith the appropriate*_systemfeature enabled, and all the other crates in your dependency tree will automatically use thesysbackend.
Both the wayland-client and wayland-server crates follow this principle, so everything will “Just
Work” when using them.
Logging
This crate can generate some runtime error message (notably when a protocol error occurs). By default
those messages are printed to stderr. If you activate the log cargo feature, they will instead be
piped through the log crate.
Re-exports
Modules
Types and utilities for manipulating the Wayland protocol
Rust implementations of the Wayland backends
client_system or server_systemImplementations of the Wayland backends using the system libwayland