wayland-protocol-statics

Crates.iowayland-protocol-statics
lib.rswayland-protocol-statics
version0.2.0+wayland-1.18.0-protocols-1.20
created_at2025-12-29 22:33:19.112076+00
updated_at2025-12-31 22:31:02.267935+00
descriptionDefinitions for stable Wayland extension protocol wl_interface statics
homepage
repositoryhttps://github.com/jbatez/wayland-headers-rs
max_upload_size
id2011597
size27,791
Jo Bates (jbatez)

documentation

README

Wayland Protocol Statics

This library provides definitions for stable Wayland extension protocol wl_interface statics.

Specifically, it includes the C source file results of running wayland-scanner {public,private}-code with wayland-protocols 1.20 stable XML files and automatically compiles/links them into your Rust program at build time.

Each protocol has a corresponding export-<protocol> and private-<protocol> feature. The export version will define the symbols with WL_EXPORT (i.e. __attribute__ ((visibility("default")))) whereas the private version will define the symbols with WL_PRIVATE (i.e. __attribute__ ((visibility("hidden")))). If both features are enabled, the export version takes precedence.

For example, if you need xdg-shell statics defined in your program and don't need them exported from your binary, include the following in your Cargo.toml:

[dependencies.wayland-protocol-statics]
version = "0.1"
features = ["private-xdg-shell"]

Then you need to convince Rust to link to the generated static library in your own code, e.g.:

#[link(name = "wayland-protocol-statics")]
unsafe extern "C" {}

or by explicitly using the crate, e.g.:

extern crate wayland_protocol_statics;

See rust-lang/cargo#9391 for why simply having the dependency is insufficient.

This library only provides C definitions. To access them from Rust, see wayland-headers.

Commit count: 0

cargo fmt