#wayland #client

wayland-client

Bindings to the standard C implementation of the wayland protocol, client side

87 releases (15 breaking)

0.21.0-alpha1 Jul 18, 2018
0.20.12 Aug 15, 2018
0.20.11 Jul 17, 2018
0.14.1 Mar 9, 2018
0.2.0 Jun 16, 2015

#4 in GUI

Download history 2331/week @ 2018-09-16 4581/week @ 2018-09-23 3854/week @ 2018-09-30 3642/week @ 2018-10-07 3689/week @ 2018-10-14 3592/week @ 2018-10-21 3479/week @ 2018-10-28 4193/week @ 2018-11-04 4832/week @ 2018-11-11 5915/week @ 2018-11-18 4142/week @ 2018-11-25 4615/week @ 2018-12-02 3719/week @ 2018-12-09

12,668 downloads per month
Used in 234 crates (13 directly)

MIT license

186KB
3.5K SLoC

crates.io Build Status codecov

Wayland rust crates

This project contains rust crates for using the wayland protocol, both client side and server side.

There are two ways to use them:

  • By default, they use a pure rust implementation of the protocol
  • If you set the native_lib cargo feature, they will rather act as bindings on top of the wayland system C libraries, and this will add methods to access pointers to the C objects in the API. You'll need to use this feature if you need to interact with a C library that requires wayland objects (typically to intialize an OpenGL context)

If you use the native_lib feature, the crates thus obviously require that the wayland C libs are installed on your system. You can however require that they are dynamically loaded at startup rather than directly linked by setting the dlopen flag. This can be useful if you want to ship a binary that should gracelly handle the absence of these libs (by fallbacking to X11 for example).

This repository actually hosts 6 crates. The 3 main crates you'll likely want to use:

  • wayland-client and wayland-server are the main crates for client and server side bindings
  • wayland-protocols regroups bindings on the official protocol extentions available

And 2 internal crates, that you'll need only for integrating a custom protocol extension:

  • wayland-commons contains the protocol logic that can be shared between client-side and server-side
  • wayland-sys is the actual C bindings, on which the crates are built
  • wayland-scanner is the crate used to convert the XML protocol specifications into rust code

Documentation

The documentation for the master branch is available online.

The documentation for the releases can be found on docs.rs:

Requirements

Requires at least rust 1.21 to be used, and version 1.13 of the wayland system libraries if using the native_lib cargo feature.

Dependencies

~1.5MB
~27K SLoC