High-level, mostly-safe OpenXR bindings

21 releases (11 breaking)

✓ Uses Rust 2018 edition

0.12.1 Apr 3, 2020
0.12.0 Mar 21, 2020
0.11.0 Feb 15, 2020
0.10.0 Nov 4, 2019
0.3.2 Mar 24, 2019

#7 in Rendering

Download history 737/week @ 2020-02-09 524/week @ 2020-02-16 670/week @ 2020-02-23 418/week @ 2020-03-01 372/week @ 2020-03-08 416/week @ 2020-03-15 601/week @ 2020-03-22 535/week @ 2020-03-29 667/week @ 2020-04-05 811/week @ 2020-04-12 1124/week @ 2020-04-19 691/week @ 2020-04-26 502/week @ 2020-05-03 161/week @ 2020-05-10 58/week @ 2020-05-17 95/week @ 2020-05-24

2,286 downloads per month


21K SLoC

Coq 11K SLoC // 0.1% comments Rust 4.5K SLoC // 0.1% comments Ruby HTML 4K SLoC // 0.0% comments PureScript 1.5K SLoC // 0.2% comments BrightScript 126 SLoC // 0.2% comments PostCSS 23 SLoC


Documentation Crates.io License: MIT License: Apache 2.0

Rust bindings for the OpenXR virtual/augmented reality runtime API. Refer to the specification for detailed documentation on individual API calls.


The high-level bindings provide abstractions focusing on ergonomics and safety. Escape hatches to the raw API are exposed to support unforeseen requirements, and patterns that cannot be efficiently exposed in safe terms are preserved as unsafe.

The crate exposes a number of cargo features:

  • static builds in the Khronos OpenXR loader, which can then be accessed with Entry::linked(). This is the easiest way to get going, provided your environment has a working C++ compiler and CMake installation.
  • loaded allows access to a manually identified OpenXR implementation at run time. This allows for cases where a built-in Khronos loader, normally responsible for that task, cannot be used.
  • linked enables access to an OpenXR implementation linked in by the application. As opposed to static, this is useful when the target environment guarantees the presence of an OpenXR implementation or loader at a specific location, making a built-in loader redundant.
  • mint exposes Into and From impls for converting to and from mint types where appropriate.


The low-level bindings provide faithful unsafe access to the raw API, with ergonomics and type safety improved as much as feasible compared to a bindgen-style binding without reducing expressiveness. For example, symbols are named according to Rust conventions, enums and bitmasks are strongly typed, and many types have helpful Debug impls. This crate is almost entirely generated from the Khronos XML registry.