Skip to content

Commit

Permalink
Merge pull request #369 from bitflags/feat/spec
Browse files Browse the repository at this point in the history
Specify the behavior of bitflags
  • Loading branch information
KodrAus committed Aug 11, 2023
2 parents 25f5adb + 6a966d7 commit 2e1be0d
Show file tree
Hide file tree
Showing 12 changed files with 1,226 additions and 646 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/rust.yml
Expand Up @@ -51,6 +51,22 @@ jobs:
- name: Default features
run: cargo bench --no-run

ui:
name: UI
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab

- name: Install Rust toolchain
run: rustup default beta

- name: Compile pass
run: cargo test pass

- name: Compile fail
run: cargo test fail

msrv:
name: MSRV
runs-on: ubuntu-latest
Expand Down
13 changes: 12 additions & 1 deletion README.md
Expand Up @@ -6,9 +6,20 @@ bitflags
[![Documentation](https://docs.rs/bitflags/badge.svg)](https://docs.rs/bitflags)
![License](https://img.shields.io/crates/l/bitflags.svg)

A Rust macro to generate structures which behave like a set of bitflags
`bitflags` generates flags enums with well-defined semantics and ergonomic end-user APIs.

You can use `bitflags` to:

- provide more user-friendly bindings to C APIs where flags may or may not be fully known in advance.
- generate efficient options types with string parsing and formatting support.

You can't use `bitflags` to:

- guarantee only bits corresponding to defined flags will ever be set. `bitflags` allows access to the underlying bits type so arbitrary bits may be set.
- define bitfields. `bitflags` only generates types where set bits denote the presence of some combination of flags.

- [Documentation](https://docs.rs/bitflags)
- [Specification](https://github.com/bitflags/bitflags/blob/main/spec.md)
- [Release notes](https://github.com/bitflags/bitflags/releases)

## Usage
Expand Down

0 comments on commit 2e1be0d

Please sign in to comment.