mirror of
https://github.com/openharmony/third_party_rust_bitflags.git
synced 2026-07-20 04:13:34 -04:00
9bd954bd9f188f4ed2cee69f85cd3b74ec89b69c
'if' now works in 'const fn as of rust 1.4.6 (https://blog.rust-lang.org/2020/08/27/Rust-1.46.0.html). I would love to have 'from_bits' be a 'const fn' because it is the safest from_* function.
bitflags
A Rust macro to generate structures which behave like a set of bitflags
Usage
Add this to your Cargo.toml:
[dependencies]
bitflags = "1.2"
and this to your crate root:
#[macro_use]
extern crate bitflags;
Rust Version Support
The minimum supported Rust version is 1.20 due to use of associated constants.
Description
一个宏,使得在 Rust 中定义和处理位标志更加容易。 | A macro that makes it easy to define and work with bitflags in Rust.
Languages
Rust
100%