docs.rs failed to build bitflag-attr-0.4.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build:
bitflag-attr-0.13.0
bitflag-attr
This is a proc-macro Rust crate that allows to turn a C-like enum into a bitflag structures with an API similar to bitfields crate.
You can use this crate to:
- provide more user-friendly bindings to C APIs where flags may or may not be fully known in advance.
You can't use this crate to:
- guarantee only bits corresponding to defined flags will ever be set.
bitflag-attrallows access to the underlying bits type so arbitrary bits may be set. - define bitfields.
bitflag-attronly generates types where set bits denote the presence of some combination of flags.
Implemented traits
The macro will also implement some traits for bitwise operations and formatting.
- core::ops::Not
- core::ops::BitAnd
- core::ops::BitOr
- core::ops::BitXor
- core::ops::BitAndAssign
- core::ops::BitOrAssign
- core::ops::BitXorAssign
- core::ops::Sub
- core::ops::SubAssign
- core::fmt::Debug
- core::fmt::Binary
- core::fmt::UpperHex
- core::fmt::LowerHex
- core::fmt::Octal
- From
- Clone
- Copy
Besides the Debug, Clone and Copy traits, all other derivable traits can be used together with the type
Example
Generate a flags structure
use bitflag;
Rust Version Support
The minimum supported Rust version is documented in the Cargo.toml file.
This may be bumped in minor releases as necessary.