re_capabilities/lib.rs
1//! Specifies capability tokens, required by different parts of the code base.
2//! These are tokens passed down the call tree, to explicitly allow different capabilities in different parts of the code base.
3//!
4//! For instance, the [`MainThreadToken`] is taken by argument in functions that needs to run on the main thread.
5//! By requiring this token, you guarantee at compile-time that the function is only called on the main thread.
6//!
7//! All capability tokens should be created in the top-level of the call tree,
8//! (i.e. in `fn main`) and passed down to all functions that require it.
9//! That way you can be certain in what an area of code is allowed to do.
10//!
11//! See [`cap-std`](https://crates.io/crates/cap-std) for another capability-centric crate.
12//!
13//! ## Feature flags
14#![doc = document_features::document_features!()]
15//!
16
17mod main_thread_token;
18
19pub use main_thread_token::MainThreadToken;