Lines Matching +full:unset +full:- +full:value
3 `bitflags` generates flags enums with well-defined semantics and ergonomic end-user APIs.
7 - provide more user-friendly bindings to C APIs where flags may or may not be fully known in advanc…
8 - generate efficient options types with string parsing and formatting support.
12 - guarantee only bits corresponding to defined flags will ever be set. `bitflags` allows access to …
13 - define bitfields. `bitflags` only generates types where set bits denote the presence of some comb…
25 ----
27 …s types are typically fixed-width unsigned integers. For example, `u8` is a bits type that defines…
29 ### Bits value
31 An instance of a bits type where each bit may be set (`1`) or unset (`0`).
33 ----
45 … same configuration; set bits in one are set in the other, and unset bits in one are unset in the …
49 Bits values define the bitwise operators and (`&`), or (`|`), exclusive-or (`^`), and negation (`!`…
55 ----
59 The following is a flag for `u8` with the name `A` that includes bit-0:
65 The following is a flag for `u8` with the name `B` that includes bit-0, and bit-5:
75 ----
87 ----
95 #### Zero-bit flag
99 ----
101 The following is a zero-bit flag:
107 #### Single-bit flag
111 ----
113 The following are single-bit flags:
120 #### Multi-bit flag
124 ----
126 The following are multi-bit flags:
141 ----
163 ----
181 ### Flags value
183 An instance of a flags type using its specific bits value for storage.
185 The flags value of a flag is one where each of its bits is set, and all others are unset.
189 Whether all set bits in a source flags value are also set in a target flags value.
191 ----
193 Given the flags value:
217 Whether any set bits in a source flags value are also set in a target flags value.
219 ----
221 Given the flags value:
244 Whether all bits in a flags value are unset.
246 ----
248 The following flags value is empty:
263 Whether all defined flags are contained in a flags value.
265 ----
298 Unset all unknown bits in a flags value.
300 ----
302 Given the flags value:
314 ----
316 Truncating doesn't guarantee that a non-empty result will contain any defined flags. Given the foll…
324 and the following flags value:
349 ----
351 …n bits are in the set of at least one defined single-bit flag, then all operations that produce no…
357 ----
370 ----
382 The bitwise exclusive-or (`^`) of the bits in two flags values.
384 ----
396 The bitwise negation (`!`) of the bits in a flags value, truncating the result.
398 ----
400 The following are examples of the complement of a flags value:
410 The bitwise union (`|`) of the bits in one flags value and the bitwise negation (`!`) of the bits i…
412 ----
414 This operation is not equivalent to the intersection of one flags value with the complement of anot…
417 ----
429 Yield the bits of a source flags value in a set of contained flags values.
431 ----
433 …value should set exactly the bits of a defined flag contained in the source. Any known bits that a…
435 ----
447 and the following flags value:
453 When iterated it may yield a flags value for `A` and `B`, then a final flag with the unknown bits:
461 It may also yield a flags value for `AB`, then a final flag with the unknown bits:
468 ----
478 and the following flags value:
484 When iterated it will still yield a flags value for the known bit `0b0000_0001` even though it does…
488 Format and parse a flags value as text using the following grammar:
490 - _Flags:_ (_Whitespace_ _Flag_ _Whitespace_)`|`*
491 - _Flag:_ _Name_ | _Hex Number_
492 - _Name:_ The name of any defined flag
493 - _Hex Number_: `0x`([0-9a-fA-F])*
494 - _Whitespace_: (\s)*
496 … by iterating over them, formatting each yielded flags value as a _Flag_. Any yielded flags value …
500 - **Retain**: Formatting and parsing roundtrips exactly the bits of the source flags value. This is…
501 - **Truncate**: Flags values are truncated before formatting, and truncated after parsing.
502 - **Strict**: A _Flag_ may only be formatted and parsed as a _Name_. _Hex numbers_ are not allowed.…
504 Text that is empty or whitespace is an empty flags value.
506 ----
530 Truncate mode will unset any unknown bits:
546 Strict mode will unset any unknown bits, as well as bits not contained in any defined named flags: