Files
archy/core/target/debug/deps/libbitflags-fe30f521014ac5df.rmeta
T

924 lines
153 KiB
Plaintext
Raw Normal View History

2026-01-24 22:59:20 +00:00
rust
ßb#rustc 1.93.0 (254b59607 2026-01-19)Áõ…·fÊ ¦%g--c48c539199cbc88bÁ³VOÐêùÿ²?ÑL¼§Ì±-a7a40eb546f9e2b0Áá\ƒ¦è3$|]åŒ[IÚ tæ-14b12edc9f8cd90bÁë&Gf·Ã ¬ëñq:¤»b-bb76018b1173caf6Áà 9m Ù„«ÐÒþá•cB;-030c5b0bba47cc8fÁrustc_std_workspace_coreÁÛ¹þÓ7>H%¸ÚÉ­-4b81d37a5530864dÁüÃùs<Uß7VyóHr#QÏ-c66cc7807550ce25Á miniz_oxideÁõFÖˆÚ™ª‹"ÞXzLVª-62cbc7af83058505Áadler2Á—wÉD‘嵯|6¨%Œ
+-2f171dd2394b4b62Á hashbrownÁ,ïcV¼¨ø¢:Ê\'È߈-9571ba9e0f6c7a90Árustc_std_workspace_allocÁ%¥Èxµù·¼5Ä3Bœ-aac566ad65903fa4Á
std_detectÁMmáýZ^9õ Îà§e˜÷e-2edb296e590136d8Árustc_demangleÁ@¼§VÉNb˜æ¨fHÌ+V3-53b132e4a2fa6e26Ácfg_ifÁfÝv.Å"ÒÜuPp¹ˆ¶-f76b385d7d4d7f3eÁ addr2lineÁÕú-WiúQVÓ¬
µT§5-fe25100bd73e48e4ÁgimliÁ¹xLáÇí÷‘o±Ñ8£Å-265ba9e6e4f70b3fÁobjectÁÔ³ÝzÓÿ¶ò°öM›¼òü`-9ae0d1f8ea52a318ÁmemchrÁRÎ÷׎™te~QÓ¿ØC\Ò-0bff3c8e8f4e489eÁ  –©HtGNÏ·ˆ!á-d69228d077d46f36Á5 AsDisplayÁL©serdeÁ<Œƒ¼Þ,ތ߼ arbitraryÁL쟼bytemuckÁDü¹¤Ù»Þ<Þ<—Œ»__impl_external_bitflags_serdeÁôÃÞŒ¢»Lû&<Û&\å&¬Û&»¹D¨'<'¹T—'¤'»"__impl_external_bitflags_arbitraryÁü·("<(\œ(¬’(»!__impl_external_bitflags_bytemuckÁüü0!<Ø0¹Tâ0¤Ø0example_generatedÁŒäå<¼åü
œÆåì¼åtestsÁ,‰æà$þå£ IterÁ  innerÁ doneÁ   __private_const_newÁ ½¥  IterNamesÁ ÂidxÁsourceÁ remainingÁ  " "Å "­
& &½&¥ IterDefinedNamesÁ* *Â*
. . 1 1½1¥ parserÁ5555555 to_writerÁ< <
impl WriteÁ5÷? ? ? 5to_writer_truncateÁC C5from_str_truncateÁF 5to_writer_strictÁH H5from_str_strictÁK K 5WriteHexÁN write_hexÁO5ParseHexÁQ parse_hexÁ5Sinvalid_hex_flagÁTimpl fmt::DisplayÁSinvalid_named_flagÁV¨S
empty_flagÁ5YÍ5traitsÁ\\\\\\\\\\ \
\ \ \j j jÿ
j˜jis_namedÁj
is_unnamedÁ\FlagsÁqFLAGSÁqBitsÁqemptyÁqàqcontains_unknown_bitsÁqbitsÁq from_bitsÁqfrom_bits_truncateÁqfrom_bits_retainÁq from_nameÁq£ q
iter_namesÁqiter_defined_namesÁqis_emptyÁqis_allÁq
intersectsÁqcontainsÁqtruncateÁqinsertÁqremoveÁqtoggleÁqsetÁqclearÁq intersectionÁqCq
differenceÁqsymmetric_differenceÁq
complementÁ\ŽEMPTYÁŽALLÁ\ PrimitiveÁ\ impl_bitsÁ\ PublicFlagsÁÜInternalÁ\BitFlagsÁþ ø \ þ ø \ \ImplementedByBitFlagsMacroÁ\ __privateÁ   Ž¤¤¤¤bitflagsÁ__impl_bitflagsÁbitflags_matchÁ__bitflags_matchÁ__bitflags_expr_safe_attrsÁ__bitflags_flagÁ
±__declare_public_bitflagsÁ±__impl_public_bitflags_forwardÁ±__impl_public_bitflagsÁ±__impl_public_bitflags_iterÁ±__impl_public_bitflags_opsÁ±__impl_public_bitflags_constsÁ¸__declare_internal_bitflagsÁ¸__impl_internal_bitflagsÁü»Ž»__impl_external_bitflagsÁ»ÿ»ú »¼
5
ParseErrorÁÁ
Áì5ÄÍ5ParseErrorKindÁÆ EmptyFlagÁÇ
ÆInvalidNamedFlagÁÉgotÁÆInvalidHexFlagÁË­5ÍÍ\FlagÁÏ Ïÿ
Ϙ\Ó ÓÍ\ÖÅÖÒ\ÙÅÙÒ\ÜýÝ \ßýà \âÖãæ\ åÖææ\
\ \ êÅêÒ\
íÅíÒ\ðýñ \óýô \öÖ÷æ\ùÖúæ\\\þÅþÒ\ÅÒ\ý \ýˆ \ŠÖæ\ÖŽæ\\\ÅÒ\ÅÒ\˜ý \ýœ \ žÖŸæ\!¡Ö¢æ\"\#\$¦Å¦Ò\%©Å©Ò\&¬ý­ \'¯ý° \(²Ö³æ\)µÖæ\*\+\,ºÅºÒ\-½Å½Ò\.ÀýÁ \/ÃýÄ \0ÆÖÇæ\1ÉÖÊæ\2\3

!
%
)
4
<
?
C
F
H
K
O
R
Z
Z
Z
m
n
o
p
v
w
{
|
}




ƒ




ˆ
Å
Å
Å
Î
Î
Î
Õ
Õ
Õ
Ý
à
ã
æ
ñ
ô
÷
ú

ˆ

Ž

œ
Ÿ
¢
­
°
³

Á
Ä
Ç
Ê
NQqŽŸÞK  þ 
  H“ ( ÞKø Â
 
­
Ô±ël–ÏSó'ÞK**,Â-
EÞ…­¼Ró'à`ÁÁ¿Ãì5 öÕŠr1•à`ÆÇÈÿÉÊ­5˸̭5)BšË¹1å`Ž)ÏŽ)à`ÏÏáÑÿ
\Ò˜\Aàø€Ö•oó'ŽŽQô*Qþ*Nô*Nþ*þ*ô*ŽŽQÀ+QÊ+NÀ+NÊ+Ê+À+ŽŽQŒ,Q,NŒ,N–,–,Œ,ŽŽQØ,Qâ,NØ,Nâ,â,Ø,ŽŽQ¤-Q®-N¤-N®-®-¤-ŽŽQð-Qú-Nð-Nú-ú-ð-ó'Ÿó' &1ÁÍÆÓÏYÁ[ÁÖÙêíþ¦©º½Üßð󘬯ÀÃâåöùŠž¡²µÆÉèéüý¤¥¸¹ÌÍÞK¦à`å`ÏŽ Q <N < <<Ÿüá8,€4‡LB
Iôá
$ó'XJ<t ˜üÇv
 ó',­ ¼ÃüàãÀ'$¸ 
³*,ó'ó'€( 3ó'ýó'ñÂ< 
@­
D
Lÿ4–üÀg
ó' ðð- ¦­$üÙÔ€(3ó'4•ó'L 3Äó'¸ó'¬Â3 
7­
;oÌô9
Æüé9%
Á :”:Xü½9WŽ)$Ú9Å)`¤Ø
Ïó' ëòlü—[³* ó'õ7Œó'ÿ
#˜'SLõ7¬müêBõ7d† ³* /\ó' ¡¢nüç; ó'ø8ê9b6¤Ýõ7-
4
±yA ð¬Ü÷oü­Jø8¢õ7¡õ7?õ7¤¶ 
 â:@ É Ð pü… Kø8, õ7õ79ô*HÄJ ÖÇô*дJØô*ÃS%CÖÇô*u8::MAXÁþ*øøJVHÂKÖÇô*þ*ø²K Ûþ*ÇS&>ÖÇô*À+çïðÈÀ+äìòÀ+ÏS%ðÈÀ+u16::MAXÁÊ+åáðÈÀ+Ê+ÞïìÊ+ÔSðÈÀ+Œ,ÅΉʌ,ÄÓŒ,ÝSè‰ÊŒ,u32::MAXÁ,ÉÆ‰ÊŒ,–,ăӖ,âSè‰ÊŒ,Ø,±º¢ËØ,°¿Ø,ëSÔó¢ËØ,u64::MAXÁâ,¹¢ËØ,â,´Ãâ,ðSØñ¢ËØ,¤-©²»Ì¤-¨¨·¤-$ùSÌë»Ì¤- u128::MAXÁ®-º·»Ì¤-®-µ«Ä®-$ÿSÙò»Ì¤-ð-¢«ÔÍð-¡¼°ð-,‰TÅäÔÍð-
usize::MAXÁú-¬©ÔÍð-ú-§¿ú-,TËäÔÍð-¬0
ÁÂ%Ž)0Å)7>5\¤±¸»$é:Žá$ï:Ï,õ:q¦Dä=ªÐD†`«ß¬õtˆ¿­Š„„®¡ÔñͯÂ|ýá°àÌõ²ôö³§´•!´ÅÜÿEµèÔ‰UŠìÉ…·Ü®¹ÙÄœ ºˆă½ÿôå$¾ú üü-"¿¼
üÞ7!ÀüÓ¼âüÓÜ5×5
Generate types for C-style flags with ergonomic APIs.
# Getting started
Add `bitflags` to your `Cargo.toml`:
```toml
[dependencies.bitflags]
version = "2.10.0"
```
## Crate features
The `bitflags` library defines a few Cargo features that you can opt-in to:
- `std`: Implement the `Error` trait on error types used by `bitflags`.
- `serde`: Support deriving `serde` traits on generated flags types.
- `arbitrary`: Support deriving `arbitrary` traits on generated flags types.
- `bytemuck`: Support deriving `bytemuck` traits on generated flags types.
## Generating flags types
Use the [`bitflags`] macro to generate flags types:
```rust
use bitflags::bitflags;
bitflags! {
pub struct Flags: u32 {
const A = 0b00000001;
const B = 0b00000010;
const C = 0b00000100;
}
}
```
See the docs for the `bitflags` macro for the full syntax.
Also see the [`example_generated`](./example_generated/index.html) module for an example of what the `bitflags` macro generates for a flags type.
### Externally defined flags
If you're generating flags types for an external source, such as a C API, you can define
an extra unnamed flag as a mask of all bits the external source may ever set. Usually this would be all bits (`!0`):
```rust
# use bitflags::bitflags;
bitflags! {
pub struct Flags: u32 {
const A = 0b00000001;
const B = 0b00000010;
const C = 0b00000100;
// The source may set any bits
const _ = !0;
}
}
```
Why should you do this? Generated methods like `all` and truncating operators like `!` only consider
bits in defined flags. Adding an unnamed flag makes those methods consider additional bits,
without generating additional constants for them. It helps compatibility when the external source
may start setting additional bits at any time. The [known and unknown bits](#known-and-unknown-bits)
section has more details on this behavior.
### Custom derives
You can derive some traits on generated flags types if you enable Cargo features. The following
libraries are currently supported:
- `serde`: Support `#[derive(Serialize, Deserialize)]`, using text for human-readable formats,
and a raw number for binary formats.
- `arbitrary`: Support `#[derive(Arbitrary)]`, only generating flags values with known bits.
- `bytemuck`: Support `#[derive(Pod, Zeroable)]`, for casting between flags values and their
underlying bits values.
You can also define your own flags type outside of the [`bitflags`] macro and then use it to generate methods.
This can be useful if you need a custom `#[derive]` attribute for a library that `bitflags` doesn't
natively support:
```rust
# use std::fmt::Debug as SomeTrait;
# use bitflags::bitflags;
#[derive(SomeTrait)]
pub struct Flags(u32);
bitflags! {
impl Flags: u32 {
const A = 0b00000001;
const B = 0b00000010;
const C = 0b00000100;
}
}
```
### Adding custom methods
The [`bitflags`] macro supports attributes on generated flags types within the macro itself, while
`impl` blocks can be added outside of it:
```rust
# use bitflags::bitflags;
bitflags! {
// Attributes can be applied to flags types
#[repr(transparent)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct Flags: u32 {
const A = 0b00000001;
const B = 0b00000010;
const C = 0b00000100;
}
}
// Impl blocks can be added to flags types
impl Flags {
pub fn as_u64(&self) -> u64 {
self.bits() as u64
}
}
```
## Working with flags values
Use generated constants and standard bitwise operators to interact with flags values:
```rust
# use bitflags::bitflags;
# bitflags! {
# #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
# pub struct Flags: u32 {
# const A = 0b00000001;
# const B = 0b00000010;
# const C = 0b00000100;
# }
# }
// union
let ab = Flags::A | Flags::B;
// intersection
let a = ab & Flags::A;
// difference
let b = ab - Flags::A;
// complement
let c = !ab;
```
See the docs for the [`Flags`] trait for more details on operators and how they behave.
# Formatting and parsing
`bitflags` defines a text format that can be used to convert any flags value to and from strings.
See the [`parser`] module for more details.
# Specification
The terminology and behavior of generated flags types is
[specified in the source repository](https://github.com/bitflags/bitflags/blob/main/spec.md).
Details are repeated in these docs where appropriate, but is exhaustively listed in the spec. Some
things are worth calling out explicitly here.
## Flags types, flags values, flags
The spec and these docs use consistent terminology to refer to things in the bitflags domain:
- **Bits type**: A type that defines a fixed number of bits at specific locations.
- **Flag**: A set of bits in a bits type that may have a unique name.
- **Flags type**: A set of defined flags over a specific bits type.
- **Flags value**: An instance of a flags type using its specific bits value for storage.
```
# use bitflags::bitflags;
bitflags! {
struct FlagsType: u8 {
// -- Bits type
// --------- Flags type
const A = 1;
// ----- Flag
}
}
let flag = FlagsType::A;
// ---- Flags value
```
## Known and unknown bits
Any bits in a flag you define are called _known bits_. Any other bits are _unknown bits_.
In the following flags type:
```
# use bitflags::bitflags;
bitflags! {
struct Flags: u8 {
const A = 1;
const B = 1 << 1;
const C = 1 << 2;
}
}
```
The known bits are `0b0000_0111` and the unknown bits are `0b1111_1000`.
`bitflags` doesn't guarantee that a flags value will only ever have known bits set, but some operators
will unset any unknown bits they encounter. In a future version of `bitflags`, all operators will
unset unknown bits.
If you're using `bitflags` for flags types defined externally, such as from C, you probably want all
bits to be considered known, in case that external source changes. You can do this using an unnamed
flag, as described in [externally defined flags](#externally-defined-flags).
## Zero-bit flags
Flags with no bits set should be avoided because they interact strangely with [`Flags::contains`]
and [`Flags::intersects`]. A zero-bit flag is always contained, but is never intersected. The
names of zero-bit flags can be parsed, but are never formatted.
## Multi-bit flags
Flags that set multiple bits should be avoided unless each bit is also in a single-bit flag.
Take the following flags type as an example:
```
# use bitflags::bitflags;
bitflags! {
struct Flags: u8 {
const A = 1;
const B = 1 | 1 << 1;
}
}
```
The result of `Flags::A ^ Flags::B` is `0b0000_0010`, which doesn't correspond to either
`Flags::A` or `Flags::B` even though it's still a known bit.
Á5\¤±¸»uvŽáuÏtq¦sªÐr«ßq¬õp­Šn®¡l¯Âj°àh²g³§f´ÅeµèdŠc·a¹Ù`ºˆ_½ÿ^¾ú ]¿¼
[ÀÑÔ×Üà:ÎÑÃÆ¸»dþ:üQL
Yield the bits of a source flags value in a set of contained flags values.
Á$†; *á$_Ï ,eq
¤W)+Ü—ün¨£
An iterator over flags values.
This iterator will yield flags values for contained, defined flags first, with any remaining bits yielded
as a final flags value.
Á  ©âó' §ó'À'H“ (
&(œ¹  €(TÒ  ´á ߇ æqó'À'üþ$ŒÎ Îó'À' 
ó'Â,ÄŠ ߇ ï‡<À'üà\¡Ï Ò Ù8°œí 3ó'ó'À'
ó' 
­
$üÇ# ߇ ÌðˆÀ'ßKàK ó'ü…($ˆÏ ÏÀ'ø°ú°û°Ðü°ý°þ°ìHˈXêE>À'ßK 
ó'$üø
ü¥ ÒÍ
An iterator over flags values.
This iterator only yields flags values for contained, defined, named flags. Any remaining bits
won't be yielded, but can be found with the [`IterNames::remaining`] method.
Á ߇ ï‡<€(Ô±ël–ÏS&(̟抾ð-LÎó'dÝó'Üî  ߇ óðˆ€(!ü$žÐ Ðó'€( ©
!ó'Âì€ ##߇ ($%üÙ\¡È Ë Ò8°œææŠó'ó'€(""ú1Â( 
1­
:ìËü³JG Get a flags value of any remaining bits that haven't been yielded yet.ÁËüŠ>; Once the iterator has finished, this method can be used toÁüÍB? check whether or not there are any bits that didn't correspondÁü”2/ to a contained, defined, named flag remaining.ÁLÒÑ Ñ€( Ñó'" Ü"
%ó'üŒ( ''߇ ðˆ,”€(()ßKàK) && ó'üß(Ò Ò€(ø°ú°û°Ðü°ý°þ°ìHˈXêE>€(ßK& ç&
)ó'ü“"'üØ ºµ
An iterator over all defined named flags.
This iterator will yield flags values for all defined named flags, regardless of
whether they are contained in a particular flags value.
Á„ž" ++߇ ¯"ï‡<²"Ñ(EÞ…­¼R,-$&ÌÁ",Á"**æŠTà"à"**ð-üï"" //߇ ô"ðˆ,÷"Ñ(0ܘ#¦#Ñ(..
0ó'ü•$/ 22߇ š$ðˆ,$Ñ(34ßKàK4 LË$$Ð$11á–üï$($ò$Ó ÓÑ(ø°ú°û°Ðü°ý°þ°ìHˈXêE>Ñ(ßK1 ÷$1
4ó'$ü$tŒ;üÁ¼
Parsing flags from text.
Format and parse a flags value as text using the following grammar:
- _Flags:_ (_Whitespace_ _Flag_ _Whitespace_)`|`*
- _Flag:_ _Name_ | _Hex Number_
- _Name:_ The name of any defined flag
- _Hex Number_: `0x`([0-9a-fA-F])*
- _Whitespace_: (\s)*
As an example, this is how `Flags::A | Flags::B | 0x0c` can be represented as text:
```text
A | B | 0x0c
```
Alternatively, it could be represented without whitespace:
```text
A|B|0x0C
```
Note that identifiers are *case-sensitive*, so the following is *not equivalent*:
```text
a|b|0x0C
```
Á4”;<?CFHKNQÁÂÆÍÁ]57WriteÁ,ü`58$Ž5:,—q5;ÄêWðEG¤‰:<(*ü–tü up
Write a flags value as text.
Any bits that aren't part of a contained flag will be formatted as a hex number.
ÁLÔ Ôó'ê³í³î³Òï³ìð³ñ³ò³ìäs{©¶ѼѼÒ¼ štÀ. =>>= ¸߇ §©âǤðˆNó'sD`Ǥ
<ó'ǤÂwriterÁ4Àbd^`ü´\ü¡
Parse a flags value from text.
This function will fail on any names that don't correspond to defined flags.
Unknown bits will be retained.
ÁD»Õ Õê³í³î³Òï³ìð³ñ³ò³ìäs{©¶ó'Ž) @@ Õ߇ ÄðˆQ•¦D‡
?ó'inputÁ,Î/1¨?<closure_kind>ÁA<closure_signature>ÁA<upvars>ÁAA?Aó',Ž)Ž) õ7É?‚©Bš©B·©BB?Bó',Ž)êªü‡yüÈ>9
Write a flags value as text, ignoring any unknown bits.
Á”ŽÖ Öó'Ǥ̤ DEDE ²߇ ¡ö¥ðˆ¦£¦
Có'ǤÂÇ¥@BEGüÔeüÂŒ
Parse a flags value from text.
This function will fail on any names that don't correspond to defined flags.
Unknown bits will be ignored.
ÁŒÛ× ×·¨ GG þ߇ íðˆ·©
Fó'Ψ$&üË^üûOJ
Write only the contained, defined, named flags in a flags value as text.
Á„ÒØ Øó'Ǥ̤ IJJI ô߇ ãö¥T„ ðˆ£¦,‰
Hó'ǤÂÇ¥8:=?üÁ$Fü # 
Parse a flags value from text.
This function will fail on any names that don't correspond to defined flags.
This function will fail to parse hex values.
Á|È$Ù Ù·¨ LL é$߇ Ø$ðˆ,Û$
Kó'Ψ,â$¸+K‚©Mš©M·©MMKMó',«êª”’-ü­,d_
Encode a value as a hex string.
Implementors of this trait should not write the `0x` prefix.
ÁDœ-NNªâü’-xNƒ¶ƒ¶OOOüË-=Ü«- Write the value as hex.ÁLÎ-Ú Ú‹¶æ̤NæPP ç-N©âŒ· Ø-‹`Œ·TÛ-
O‹¶Œ·$è-Ç¥4î-02”´.üŒ.'"
Parse a value from a hex string.
ÁD¾.QQƒ¶ü´.‘Qƒ¶ƒ¶RRRüï.TìÍ. Parse the value from hex.ÁLò.Û Ûê³í³î³Òï³ìð³ñ³ò³ìäs{©¶‹¶Ž)Q ƒ/Q©â‹¶,½/
R‹¶Ψ,ü.|¦3Ž)TVXüé38ü¼3(% An invalid hex flag was encountered.Á„ð3¨Ž)S¨UUS©â»»Œ‡4å`»»dŒ4
T»»flagÁ$4(*üÞ6:ü‡6RO A named flag that doesn't correspond to any on the flags type was encountered.Á”å6»»Ž)S¨WWSß»Œþ6ð»dƒ7
V»»‰»$ø6ü½9!ü€985 A hex or named flag wasn't found between separators.ÁTÊ9Ž)SS
Xü˜: Ž)Zæ`Zü¿:8Â:ÜÝÞ ÜŽ) ÝÁ`Á`œÃ`è Á]Ä`bufÁÁ]Ê­\É:•Þ̤Y Æ:Y
Z$Ç:þ Í:üë@%»Õ@ Ø@ è@8<Ù@ á@7,ã@¼Ó@Ž)T;4¡;Ÿ ÏÍÁ]\^BitAndÁ4Ãî\`BitOrÁ,'ãï\aBitXorÁ4.ƒñ\bNotÁ6˜\c£ $Q\e¿TdÁ\gîDpQ\hÇDzN\9·¹¥§|~jlüDB`bUWGI:<|“ kk߇ ˜³*lmnopü—6ü©id
Define a flag.
If `name` is non-empty then the flag is named, otherwise it's unnamed.
Á¤ã–ó'³*jj
ló'ÿ
z˜ƒüê(üømh
Get the name of this flag.
If the flag is unnamed then the returned string will be empty.
Á$÷ß ß³*ã–j üj
mó'üçü²0+
Get the flags value of this flag.
Á,ôà à³* àó'j új
nó'ü­$ü¨{
Whether the flag is named.
If [`Flag::name`] returns a non-empty string then this method will return `true`.
ÁDºá á³*j Ãj
oó'ü… &üýƒ~
Whether the flag is unnamed.
If [`Flag::name`] returns a non-empty string then this method will return `false`.
ÁT’ â â³*j j
pó'üï üÔ š 
A set of defined flags using a bits type as storage.
## Implementing `Flags`
This trait is implemented by the [`bitflags`](macro.bitflags.html) macro:
```
use bitflags::bitflags;
bitflags! {
struct MyFlags: u8 {
const A = 1;
const B = 1 << 1;
}
}
```
It can also be implemented manually:
```
use bitflags::{Flag, Flags};
struct MyFlags(u8);
impl Flags for MyFlags {
const FLAGS: &'static [Flag<Self>] = &[
Flag::new("A", MyFlags(1)),
Flag::new("B", MyFlags(1 << 1)),
];
type Bits = u8;
fn from_bits_retain(bits: Self::Bits) -> Self {
MyFlags(bits)
}
fn bits(&self) -> Self::Bits {
self.0
}
}
```
## Using `Flags`
The `Flags` trait can be used generically to work with any flags types. In this example,
we can count the number of defined named flags:
```
# use bitflags::{bitflags, Flags};
fn defined_flags<F: Flags>() -> usize {
F::FLAGS.iter().filter(|f| f.is_named()).count()
}
bitflags! {
struct MyFlags: u8 {
const A = 1;
const B = 1 << 1;
const C = 1 << 2;
const _ = !0;
}
}
assert_eq!(3, defined_flags::<MyFlags>());
```
Áqq³º,€‹¶q³º"ÖÔ³º.ÖÔ)rstuvwxyz{|}~ƒˆŠŒrstuvwxyz{|}~ƒˆŠŒ©â‹¶s„ƒŽæÕÞÕõÕŒy|tŠwz}ˆuxƒ{~vü¸"ì– The set of defined flags.Á,¾qq 
ÏÏáÑÿ
\Ò˜\Aàø€Ö•o‹¶ìá The underlying bits type.Á$ˆqq”Èü™*' Get a flags value with all bits unset.Á,Ë‹¶qq
t‹¶„Íüš.+ Get a flags value with all known bits set.ÁЋ¶qq
u‹¶üö'ü²?< This method will return `true` if any unknown bits are set.Á¬ùã ã‹¶q q
v‹¶$ìÚüã" Get the underlying bits value.ÁŠËü’C@ The returned value is exactly the bits set in this flags value.Á$Ýä ä‹¶æÕq âq
w‹¶üì.ôý Convert from a bits value.Á Ëü¨?< This method will return `None` if any unknown bits are set.ÁLïæÕø°ú°û°Ðü°ý°þ°ìHˈXêE>‹¶qq
x‹¶ÓüŽ/üÏ:7 Convert from a bits value, unsetting any unknown bits.Á”‘æÕ‹¶qq
y‹¶Óü°.ü…&# Convert from a bits value exactly.Á„³æÕ‹¶qq
z‹¶Óü¢ (üäFC Get a flags value with the bits of a flag with the given name set.Á¯Ëü·@= This method will return `None` if `name` is empty or doesn'tÁüü! correspond to any named flag.ÁL¥ å å¢Þq µ q
{‹¶ÿ
üÍ$"ü‚#*' Yield a set of contained flags values.Á±#Ëü¹#VS Each yielded flags value will correspond to a defined named flag. Any unknown bitsÁü”$41 will be yielded together as a final flags value.Á$Ð$æ æ‹¶  þ 
  H“ (‹¶q Õ$q
|‹¶$Ö$ü”'-ü›%0- Yield a set of contained named flags values.ÁÐ%ËüØ%ZW This method is like [`Flags::iter`], except only yields bits in contained named flags.Áü·&XU Any unknown bits, or bits not corresponding to a contained flag will not be yielded.ÁT—'ç ç‹¶ø Â
 
­
Ô±ël–ÏS‹¶q ¢'q
}‹¶$£'üµ(7üò'>; Yield a set of all named flags defined by [`Self::FLAGS`].Á”¸(**,Â-
EÞ…­¼R‹¶qq
~‹¶ÔØ)ü )30 Whether all bits in this flags value are unset.ÁDÛ)è è‹¶q ä)q
‹¶$å)Äå*ü©*74 Whether all known bits in this flags value are set.Á4è*é é‹¶q ï*q
‹¶$ð*ü¥-HüÊ,VS Whether any set bits in a source flags value are also set in a target flags value.ÁT¨-ê ê‹¶‹¶q ³-q³º,ç-
‹¶$´-î ,º-ü’/Fü·.VS Whether all set bits in a source flags value are also set in a target flags value.ÁD•/ë ë‹¶‹¶q ž/q³º,Ò/
‹¶$Ÿ/î ,¥/üÍ05ü0+( Remove any unknown bits from the flags.ÁDÐ0ì ì‹¶q Ù0q³º,ü0
ƒ‹¶$Þ0ü‰2@üË196 The bitwise or (`|`) of the bits in two flags values.Á4Œ2í í‹¶‹¶q “2q³º,Ã2
‹¶$˜2î ,ž2üª5@ü3`] The intersection of a source flags value with the complement of a target flags value (`&!`).Á4ËüŠ4WT This method is not equivalent to `self & !other` when `other` has unknown bits set.Áüæ4?< `remove` won't truncate `other`, but the `!` operator will.Á4­5î î‹¶‹¶q ´5q³º,ä5
‹¶$¹5î ,¿5ü‹7@üÃ6C@ The bitwise exclusive-or (`^`) of the bits in two flags values.Á4Ž7ï ï‹¶‹¶q •7q³º,Å7
‹¶$š7î , 7ü’9Jü®8_\ Call [`Flags::insert`] when `value` is `true` or [`Flags::remove`] when `value` is `false`.Á•9ð ð‹¶‹¶q ™9q³º,Ö9
‹¶$ž9î ,¤9˜,±9ü‚;2üÜ:! Unsets all bits in the flags.Á,…;ñ ñ‹¶q ‹;q³º,®;
ˆ‹¶$;ü´<*üå;:7 The bitwise and (`&`) of the bits in two flags values.Á,\¤<d·<‹¶‹¶‹¶qq
‹¶$Ä<î ,Ê<üõ=#ü§=9±ð,\å=,ø=‹¶‹¶‹¶qq
Š‹¶$þ=î ,„>ü‚A(üá>`ÜñÆ?ËüÎ?WÐòüª@C@ `difference` won't truncate `other`, but the `!` operator will.Á,\ò@T…A‹¶‹¶‹¶qq
‹¶$Aî ,–AüÌB2üôACáô,\¼B¤ÏB‹¶‹¶‹¶qq
Œ‹¶$äBî ,êBܯDüÇCSP The bitwise negation (`!`) of the bits in a flags value, truncating the result.Á,\ŸDT²D‹¶‹¶qq
‹¶$½DüÆEºü…E@;
A bits type that can be used as storage for a flags type.
Á$ÐEŽŽ
³º,íFÞ‹¶,ÚEþ‹¶$æEž‹¶‹¶LñEÃî‹¶‹¶¬F‹¶‹¶Åî‹¶lˆFãï‹¶‹¶¤F‹¶‹¶åï‹¶l£Fƒñ‹¶‹¶¬¸F‹¶‹¶…ñ‹¶l¿F˜‹¶”ÔF‹¶‹¶lØFÖÔ<ùF޳ºþ¨€ô¸€êÈ€ÜÜ€Íñ€»¬žšËyãoóbÖÔ`³ºL¨€C¸€:È€-Ü€ñ€žïàËÎãÄó·ÖÔµŒ¬Gü‡G  A value with all bits unset.Á,²GŽŽ‹¶|çGôÄG A value with all bits set.ÁíGŽŽ‹¶œ‡IL‘Iƒ¶´‡Iƒ¶ƒ¶´ŸIL¬I ¶I ¯S ¼I ÎI, ½I ¾I ÌI
, ¿I8 ÀI& ÁI8ÂI$ ÄI, ÆI8» ÇI& ÈI8ÉI$ ËI
ÍI*ÐI ÓI ­S, ÝI ÞI ¦S08$ìI8$ñI8
öI, úI8Ó„ ûI ýI ÛJ8,J8Å,•J& šJ, œJ8Ó„ J ŸJ7ì ¡J% ¢J8,´J8ÒºJ& ½J, ¿J8Ó„ ÀJ ÂJ ÄJ, ÅJ8Ó„ ÆJ ÇJ'ÈJ8MAXÁÊJ% ÍJ8$êJ8$ïJ8
ôJ, øJ8» ùJ ûJ ßK8,K8Å,“K& ˜K, šK8» K K7ì ŸK%  K8,²K8Ò¸K& »K, ½K8» ¾K ÀK ÂK, ÃK8Ó„ ÄK ÅK'ÆK8¸‡ÈK8ÌK, ÏK8» ÐK% ÑK8$îK8îDóK8
üK, €L8Ó„ L ƒL ÐM 8 •L8ýL˜L ¡L ­L8Ψ,¢L& §L ©L8œªL(¯L8ý4²L ¸L8$¹L$ ½L8¿T¿L ÉL ËL ÂM
 áL, âL8Ó„ ãL äL'åL8from_str_radixÁtçL õL ÿL8Ψ,öL$ ûL716ÁýL €M8
<M ˆM °M ‰M8 ŠM M8¿TM'—M8„™M ©M ¯M8Ψ,ªM8$ßM8îDäM8
íM, ñM8» òM ôM ÁO 8 †N8ýL‰N ’N žN8Ψ,“N& ˜N šN8œN( N8ý4£N ©N8$ªN$ ®N8¿T°N ºN ¼N ³O
 ÒN, ÓN8» ÔN ÕN'ÖN8Ö‹tØN æN ðN8Ψ,çN$ ìN7ŒîN ñN8
<òN ùN ¡O úN8 ûN üN8¿TþN'ˆO8„ŠO šO  O8Ψ,O8$ÐO8ÇDÕO8
ÞO, âO8Ó„ ãO åO ‰Q8 ÷O8ÖLúO ƒP8æ „P& …P8͇P'ŠP8¾¡,ŒP ‘P P §P “P8$”P$ ˜P8šP8Ç¥4žP& ¤P8æ ¦P(©P8ͬP'¯P8ý4±P ¸P ûP8writeÁ,ÎP ÓP ÔP éP8Ç¥4ÕP$ ÛP7{:x}Á4ÝP$ ãP8$åP8$˜Q8ÇDQ8
¦Q, ªQ8» «Q ­Q ÑR8 ¿Q8ÖLÂQ ËQ8æ ÌQ& ÍQ8ÍÏQ'ÒQ8¾¡,ÔQ ÙQ ÚQ ïQ ÛQ8$ÜQ$ àQ8âQ8Ç¥4æQ& ìQ8æ îQ(ñQ8ÍôQ'÷Q8ý4ùQ €R ÃR8µ’,R R œR ±R8Ç¥4R$ £R7í’4¥R$ «R8$­R8$àR8ÜLåR8
ïR, óR8» ôR öR ÷R8$…S8ÜLŠS8
”S, ˜S8Ó„ ™S S œS
§S¬ûTüšT>; A trait for referencing the `bitflags`-owned internal typeÁüÙT! without exposing it publicly.Á\…Uƒ¶üûT¼ƒ¶ƒ¶©â‹¶ÔÃU¸™LÓU°™È™©â‹¶t§Vå™ÌÃUü—U'$ The type of the underlying storage.ÁLÈUl§VüãU?< The type of the internal field on the generated flags type.ÁD¬VüþV6¡»V ¾V ÅV8°4¿Vt¹Vuse the `Flags` trait insteadÁüÈV5DˆWÙšƒ¶üþV½Ÿ‹¶Ô’Wq‹¶,¯Wƒ¶9­œ-½œ$ƒ¶K­œ?½œ6—˜˜©â‹¶üþW!ÞK¬‰XßK‹¶\’X,¢!²©â‹¶˜üƒY6ÞKàü“Y%àßKã–‹¶ÜœYØ2ñ'‚žüþW ü»W>; An iterator over enabled flags in an instance of the type.Á$ƒXÙšüƒY5ü¥XYV An iterator over the raw names and bits for enabled flags in an instance of the type.ÁLˆYÙšìÒY šš߇ ×Yðˆ,ÚYó'›œ˜LöY$ûYÀ't˜ZLZ€(üÃZ/ žž߇ ÈZðˆ,ËZó'üš]$ü÷Zeb A marker trait that signals that an implementation of `BitFlags` came from the `bitflags!` macro.ÁÝ[Ëüá[c` There's nothing stopping an end-user from implementing this trait, but we don't guarantee theirÁüÅ\EB manual implementations won't break between non-breaking releases.Á¡] ] —]8°4]t‹]Ô¤]ŸŸƒ¶üš]'Ÿƒ¶ƒ¶ÄÃ]LÒ]íÔò]Ÿ¢ü\Ž^£üê]0&(Œ¹;¡¬; ¯; ¶;8°4°;tª;LÁ;³$‡=¨ísŸ§¢üu§£üÃ<5œË<Œã<CED±=„Ü=F$¬ù_üùKïê
Generate a flags type.
# `struct` mode
A declaration that begins with `$vis struct` will generate a `struct` for a flags type, along with
methods and trait implementations for it. The body of the declaration defines flags as constants,
where each constant is a flags value of the generated flags type.
## Examples
Generate a flags type using `u8` as the bits type:
```
# use bitflags::bitflags;
bitflags! {
struct Flags: u8 {
const A = 1;
const B = 1 << 1;
const C = 0b0000_0100;
}
}
```
Flags types are private by default and accept standard visibility modifiers. Flags themselves
are always public:
```
# use bitflags::bitflags;
bitflags! {
pub struct Flags: u8 {
// Constants are always `pub`
const A = 1;
}
}
```
Flags may refer to other flags using their [`Flags::bits`] value:
```
# use bitflags::bitflags;
bitflags! {
struct Flags: u8 {
const A = 1;
const B = 1 << 1;
const AB = Flags::A.bits() | Flags::B.bits();
}
}
```
A single `bitflags` invocation may include zero or more flags type declarations:
```
# use bitflags::bitflags;
bitflags! {}
bitflags! {
struct Flags1: u8 {
const A = 1;
}
struct Flags2: u8 {
const A = 1;
}
}
```
# `impl` mode
A declaration that begins with `impl` will only generate methods and trait implementations for the
`struct` defined outside of the `bitflags` macro.
The struct itself must be a newtype using the bits type as its field.
The syntax for `impl` mode is identical to `struct` mode besides the starting token.
## Examples
Implement flags methods and traits for a custom flags type using `u8` as its underlying bits type:
```
# use bitflags::bitflags;
struct Flags(u8);
bitflags! {
impl Flags: u8 {
const A = 1;
const B = 1 << 1;
const C = 0b0000_0100;
}
}
```
# Named and unnamed flags
Constants in the body of a declaration are flags. The identifier of the constant is the name of
the flag. If the identifier is `_`, then the flag is unnamed. Unnamed flags don't appear in the
generated API, but affect how bits are truncated.
## Examples
Adding an unnamed flag that makes all bits known:
```
# use bitflags::bitflags;
bitflags! {
struct Flags: u8 {
const A = 1;
const B = 1 << 1;
const _ = !0;
}
}
```
Flags types may define multiple unnamed flags:
```
# use bitflags::bitflags;
bitflags! {
struct Flags: u8 {
const _ = 1;
const _ = 1 << 1;
}
}
```
Á&|é_X$ ` ñ}  •` b, Ÿ`  ` ¯`+ ¡` ¢` ®`, £`8outerÁ,¤`& ©`8«
$ª`
°`, º`8¬»`& ¾`8¬¿`84Ã`, Ê`8¦DË`& Ó`8Û,Ô`& Ù`, Û`8 Ü`& Ý`8Þ` á` èa, ï` ð` Ýa, a ƒa  a+ „a …a Ÿa, †a8 ,‡a& Œa8Û,a, “a ”a a, •a8þ$a& ša8a
ža
¡a8,³a, ¹a8á$ºa& ¾a8¿a Âa, Äa8˜,Åa& Êa8ï$Ëa% Ïa
Þa, óa ôa úa, õa8 öa& ÷a8øa
ûa*ƒb †b s, üb8,ýb'c8àÌ„c c Ÿc åc, ­c ®c ¸c+ ¯c °c ·c, ±c8‚º,²c
¹c, Çc8¬Èc84Ìc, Óc8¦DÔc, »d8,¼d'Ád8ŠìÃd àd âd f, ðd8¦Dñd& ùd, ûd8 üd þd ˆf, e e ùe
, §e ¨e ¼e+ ©e ªe »e, «e8 ,¬e, ²e ³e ¹e, ´e8þ$µe
ºe
½e8,Óe, Ùe8á$Úe ße, áe8˜,âe% çe
úe+ f žf •i8è,Ÿf ¤f ”i8áL²f$ »f8ÿTÉf$ Óf8unused_doc_commentsÁœáf$ ôf8unused_attributesÁŒ‚g$ “g8
unused_mutÁT¡g$ «g8ût¹g$ Çg8non_upper_case_globalsÁ´Õg$ ëg8Æ4ùg'ÿg8assign_op_patternÁŒh$ h8Æ4 h'¦h8indexing_slicingÁ„¨h$ ¸h8Æ4Æh'Ìh8same_name_methodÁ„Îh$ Þh8Æ4ìh'òh8iter_without_into_iterÁ´ôh$ Ši8,Ÿi8 ¥i& ¦i ¨i ©i «i ­i Îr$, Äj8,Åj'Êj8ÜÌj çj éj ¨k, ûj8¬üj84€k8InternalBitFlagsÁ„‡k& —k, ™k8 šk, ·k8,¸k'½k8ÙÄ¿k ×k Ùk ·m8ÅÆ„ëk& ûk, ýk8 þk$ ÿk, l8¦Dl l ©m, ¡l ¢l m
, ¼l ½l Ñl+ ¾l ¿l Ðl, Àl8 ,Ál, Çl Èl Îl, Él8þ$Êl
Ïl
Òl8,ìl, òl8á$ól øl, úl8˜,ûl% €m
—m, n8,“n'˜n8ˆÄšn ²n ´n ‰p8ÅÆ„Æn& Ön, Øn8 Ùn$ Ún, Ün8¦DÝn æn ûo, ün ýn èo, —o ˜o ¬o+ ™o šo «o, o8 ,œo, ¢o £o ©o, ¤o8þ$¥o
ªo
­o8,Ço, Ío8á$Îo% Òo
éo, ˜p8,™p'žp8ô p ¾p Àp þp, Òp8¦DÓp& Ûp, Ýp8 Þp$ ßp8ÅÆ„áp, q8,Žq'“q8èÔ•q ¯q ±q Ùq, Ãq8¦DÄq, èq8,éq'îq8ÅÜðq r r Är, Ÿr8¦D r& ¨r, ªr8 «r$ ¬r, ®r8¦D¯r% Ïr, Úr8,Ûr'àr8ÐDâr êr ìr ‰s, úr ûr þr, ür8ݽ ýr
ÿr% s s ÷t,  s ¡s °s+ ¢s £s ¯s, ¤s8‚º,¥s& ªs8«
$«s
±s8$»s, Às8¦DÁs& És8Û,Ês& Ïs, Ñs8 Òs& Ós8Ôs ×s Þt, ås æs Ót, øs ùs t+ ús ûs •t, üs8 ,ýs& t8Û,ƒt, ‰t Št “t, t8þ$Œt& t8t
”t
—t8,©t, ¯t8á$°t& ´t8µt ¸t, ºt8˜,»t& Àt8ï$Át% Åt
Ôt, ét êt ðt, ët8ݽ ìt& ít8ît
ñt*ùt üt à}, †u8,‡u'Œu8ŠìŽu «u ­u Ýv, »u8¦D¼u& Äu, Æu8 Çu Éu Óv, Ûu Üu Äv
, òu óu ‡v+ ôu õu †v, öu8 ,÷u, ýu þu „v, ÿu8þ$€v
…v
ˆv8,žv, ¤v8á$¥v ªv, ¬v8˜,­v% ²v
Åv+ èv év ”y8è,êv ïv “y8áLýv$ †w8ÿT”w$ žw8Áœ¬w$ ¿w8æÂŒÍw$ Þw8‰ÃTìw$ öw8ût„x$ x8·Ã´ x$ ¶x8Æ4Äx'Êx8ñÃŒÌx$ Ýx8Æ4ëx'ñx8ŽÅ´óx$ ‰y8,žy8 ¤y& ¥y §y ¨y ªy ¬y Ÿ}, ºy8,»y'Ày8§´Ây Øy Úy Ï{ , ìy íy ÷y+ îy ïy öy, ðy8‚º,ñy
øy, Šz8¦Dz& “z, •z8 z$ —z, ™z8¦Dšz £z Á{, ¹z ºz ®{
, Ôz Õz éz+ Öz ×z èz, Øz8 ,Ùz, ßz àz æz, áz8þ$âz
çz
êz8,„{, Š{8á${ {, {8˜,“{% ˜{
¯{, Þ{8,ß{'ä{8èÔæ{ €| | ª|, ”|8¦D•|, ¹|8,º|'¿|8ÅÜÁ| Ü| Þ| •}, ð|8¦Dñ|& ù|, û|8 ü|$ ý|, ÿ|8¦D€}%  }, «}8,¬}'±}8ÐD³} »} ½} Ú}, Ë} Ì} Ï}, Í}8ݽ Î}
Ð}% á} ç} è}*ê} í} î}% ï}äÖüô}*' Implement functions on bitflags types.ÁŸ~Ëü£~^[ We need to be careful about adding new methods and trait implementations here because theyÁü‚41 could conflict with items added by the end-user.Á¡É Ì Ó8°&|·h$ ó ã° ù š‹(8paramsÁ4‰& , 8$& 8Û,—$ œ, ž8Ó& £8Û$ ©, «8ÿ
& °8Û$ , ¸8î & ¾8Û,¿$ Ä, Æ8˜& Ì8Û% Ò, Ü Ý ì+ Þ ß ë, à8‚º& æ8«

í, ÷8PublicBitFlagsÁ& †‚8Û,‡‚& Œ‚, Ž‚8 & 8‘‚ ”‚ ”‹Œ8 ¢‚8¤,¥‚ ª‚ «‚, ­‚8
empty_bodyÁT®‚& ¸‚8ó,¹‚8 Ë‚8à΂ Ñ‚ Ò‚, Ô‚8all_bodyÁDÕ‚& Ý‚8ó,Þ‚8 ð‚8Ó$ó‚ ÷‚ ý‚ ø‚8$ù‚, ÿ‚8 bits_bodyÁL€ƒ& ‰ƒ8ó,Šƒ8 œƒ8ÞLŸƒ ¨ƒ ­ƒ8Ó$©ƒ, ¯ƒ8from_bits_bodyÁt°ƒ& ¾ƒ8ó,¿ƒ8 у8î”Ôƒ æƒ ëƒ8Ó$çƒ, íƒ8from_bits_truncate_bodyÁ¼îƒ& …„8ó,†„8 ˜„8„›„ «„ °„8Ó$¬„, ²„8from_bits_retain_bodyÁ¬³„& È„8ó,É„8 Û„8žLÞ„ ç„ ì„8ÿ
$è„, î„8from_name_bodyÁtï„& ý„8ó,þ„8 8ßD“… ›… ¡… œ…8$, £…8
is_empty_bodyÁl¤…& ±…8ó,²…8 Ä…8î4Ç… Í… Ó… Î…8$Ï…, Õ…8 is_all_bodyÁ\Ö…& á…8ó,â…8 ô…8ûT÷…  ކ ‚†8$ƒ†$ ‡†8î ,‰†, 8intersects_bodyÁ|‘†&  †8ó,¡†8 ³†8ŒD¶† ¾† ˆ ¿†8$À†$ Ć8î ,Ɔ, ͆8
contains_bodyÁlΆ& Û†8ó,܆8 î†8ª4ñ† ÷† ˆ‡ ø†8ù†8$ý†$ 8î ,ƒ‡, Ї8 insert_bodyÁ\‹‡& –‡8ó,—‡8 ©‡8·4¬‡ ²‡ Ç ³‡8´‡8$¸‡$ ¼‡8î ,¾‡, Ň8 remove_bodyÁ\Ƈ& ч8ó,Ò‡8 ä‡8Ä4ç‡ í‡ þ‡ î‡8ï‡8$ó‡$ ÷‡8î ,ù‡, €ˆ8 toggle_bodyÁ\ˆ& Œˆ8ó,ˆ8 Ÿˆ8Ñ¢ˆ ¥ˆ ½ˆ ¦ˆ8§ˆ8$«ˆ$ ¯ˆ8î ,±ˆ$ ¶ˆ8˜,¸ˆ, ¿ˆ8set_bodyÁDÀˆ& Ȉ8ó,Ɉ8 Ûˆ8çdÞˆ êˆ öˆ8$ëˆ$ ïˆ8î ,ñˆ, øˆ8intersection_bodyÁŒùˆ& Љ8ó,‹‰8 8C, ‰ ¥‰ ±‰8$¦‰$ ª‰8î ,¬‰, ³‰8
union_bodyÁT´‰& ¾‰8ó,¿‰8 щ8TÔ‰ Þ‰ ê‰8$߉$ ã‰8î ,å‰, ì‰8difference_bodyÁ|í‰& ü‰8ó,ý‰8 Š8¤’Š ¦Š ²Š8$§Š$ «Š8î ,­Š, ´Š8symmetric_difference_bodyÁ̵Š& Ί8ó,ÏŠ8 áŠ8¬TäŠ îŠ óŠ8$ïŠ, õŠ8complement_bodyÁ|öŠ& …‹8ó,†‹*œ‹ Ÿ‹ à° + ©‹ ª‹ Ú‹8è,«‹ °‹ Ù‹8áL±‹$ º‹8ÿT¼‹$ Æ‹8æÂŒÈ‹, ä‹ å‹ ï‹+ æ‹ ç‹ î‹, è‹8‚º,é‹
ð‹8$ú‹, ÿ‹8¸ãt€Œ Œ Ú°<È×üŒ*+ ÔŒ ÕŒ ÜŒ8þ4ÖŒ8êŒ8,îŒ8 ôŒ8¤,÷Œ üŒ ýŒ(ÿŒ8$‚, 8Ôä<³Øü°.+ ë ì ó8þ8Ž8,…Ž8 ‹Ž8àŽŽ ‘Ž ’Ž(”Ž8$—Ž, ¬Ž8¬åD­Ž<¾ÚüÃŽ"<ËòŽ<ôÚü‚C+ Ò Ó Ú8þ8è88 ò8Ó ù  ú, û8(, 8 , ˜8•æL™<•Üô°<ËÛ<ÇÜüë?+ ·‘ ¸‘ ¿‘8þ4¹‘8Í‘8,Ñ‘8 ב8ÞLÚ‘ ã‘ í‘, ä‘8Ó$å‘& é‘, ë‘8 ì‘(ï‘, ò‘8,ó‘'ø‘8ŽLú‘'ƒ’8³$…’'‰’8ä 4‹’'‘’8Ó4“’ ™’8$š’ ž’, °’8øæt±’<—ÞüÍ’:+ ”“ •“ œ“8þ4–“8ª“8,®“8 ´“8î”·“ É“ Ó“, Ê“8Ó$Ë“& Ï“, Ñ“8 Ò“(Õ“8$Ø“, í“8àç¼î“<žßü“”&+ Æ” Ç” Δ8þ4È”8Ü”8,à”8 æ”8„é” ù” ƒ•, ú”8Ó$û”& ÿ”, 8 ‚•(…•8$ˆ•, 8Ñ謞•<‘àüÁ•F<Ë”–<ëàü¤–@<´áüñ–!+ Ÿ—  — §—8þ4¡—8µ—8 ¹—8žL¼— Å— Ñ—, Æ—8ÿ
$Ç—& Ë— Í—8œΗ(Ó—, Ö—8,×—'Ü—8ŽLÞ—'ç—8³$é—'í—8ä 4ï—'õ—8Ó4÷— ý—8$þ— ‚˜, ”˜8Àét•˜<íéü±˜3+ ñ˜ ò˜ ù˜8þ4ó˜8‡™8,‹™8 ‘™8ßD”™ œ™ £™ , ž™8$Ÿ™(¥™8õ$¨™, ½™8¯êl¾™<üêüÙ™7+ š žš ¥š8þ4Ÿš8³š8,·š8 ½š8î4Àš Æš Íš Çš, Èš8$Éš(Ïš8õ$Òš, çš8ë\èš<‘ìüV+ ä› å› ì›8þ4æ›8ú›8,þ›8 „œ8ûT‡œ ‘œ ¦œ ’œ, “œ8$”œ$ ˜œ, šœ8î ,›œ&  œ8$¢œ(¨œ8õ$«œ, Àœ8ì|Áœ<ØíüÞœV+ Á  É8þ8×88 á8Œ ì ž í, î8$ ó, õ8î & û8(ƒž8õ$†ž, ›ž8¡ílœž<±ðü·ž9+ ýž þž …Ÿ8þ4ÿž8“Ÿ8 —Ÿ8ª4šŸ  Ÿ ¹Ÿ  ¡Ÿ8¢Ÿ, ¦Ÿ8$§Ÿ$ «Ÿ, ­Ÿ8î ,®Ÿ& ³Ÿ8$µŸ, ËŸ8®î\ÌŸ<O The intersection of a source flags value with the complement of a target flagsÁüåŸR< value (`&!`).ÁŒÄ <Ëâ <Ðòüò W<°óüÖ¡?+ ¢¢ £¢ ª¢8þ4¤¢8¸¢8 ¼¢8·4¿¢ Å¢ Þ¢  Æ¢8Ç¢, Ë¢8$Ì¢$ Т, Ò¢8î ,Ó¢& Ø¢8$Ú¢, ð¢8¹ï\ñ¢<áôüŠ£C+ Ú£ Û£ â£8þ4Ü£8ð£8 ô£8Ä4÷£ ý£ –¤  þ£8ÿ£, ƒ¤8$„¤$ ˆ¤, Ф8î ,‹¤& ¤8$’¤, ¨¤8Äð\©¤<J Call `insert` when `value` is `true` or `remove` when `value` is `false`.Áü¤M+ œ¥ ¥ ¤¥8þ4ž¥8²¥8 ¶¥8ѹ¥ ¼¥ 㥠½¥8¾¥, Â¥8$Ã¥$ Ç¥, É¥8î ,Ê¥& Ï¥8$Ñ¥$ Õ¥, ×¥8˜,Ø¥& Ý¥8õ$ߥ, õ¥8ãñDö¥<øøüŒ¦:+ Ó¦ Ô¦ Û¦8þ4Õ¦+ é¦ ê¦ ó¦8÷
Dë¦8§8,…§8 ‹§8çdާ š§ ®§, ›§8$œ§$  §, ¢§8î ,£§& ¨§8$ª§(°§8$³§, ȧ8ØòŒÉ§<±ðüè§9+ ®¨ ¯¨ ¶¨8þ4°¨+ Ĩ Ũ Ψ8÷
Dƨ8ܨ8,à¨8 æ¨8C,é¨ î¨ ‚©, ï¨8$ð¨$ ô¨, ö¨8î ,÷¨& ü¨8$þ¨(„©8$‡©, œ©8ÕóT©<üµ©R<ª<˲ª<ÐòüªW<™ûü¦«C+ ö« ÷« þ«8þ4ø«+ Œ¬ ¬ –¬8÷
Dެ8¤¬8,¨¬8 ®¬8T±¬ »¬ Ϭ, ¼¬8$½¬$ Á¬, ì8î ,Ĭ& ɬ8$ˬ(Ѭ8$Ô¬, é¬8Ìô|ê¬<áôü‡­C+ ×­ Ø­ ß­8þ4Ù­+ í­ î­ ÷­8÷
Dï­8…®8,‰®8 ®8¤’® ¦® º®, §®8$¨®$ ¬®, ®®8î ,¯®& ´®8$¶®(¼®8$¿®, Ô®8ÈõÌÕ®<ýüü®S+ ܯ ݯ ä¯8þ4Þ¯+ ò¯ ó¯ ü¯8÷
Dô¯8а8,ް8 ”°8¬T—° ¡° §°, ¢°8$£°(©°8$¬°, Á°8ºö|°% á°Üû¾üæ°KH A macro that matches flags values, similar to Rust's `match` statement.Á²±Ëü¶±c` In a regular `match` statement, the syntax `Flag::A | Flag::B` is interpreted as an or-pattern,Áüš²ol instead of the bitwise-or of `Flag::A` and `Flag::B`. This can be surprising when combined with flags typesÁüгli because `Flag::A | Flag::B` won't match the pattern `Flag::A | Flag::B`. This macro is an alternative toÁü÷³:7 `match` for flags values that doesn't have this issue.Á²´Ëd¶´ # SyntaxÁôËlÇ´
```ignoreÁüÕ´! bitflags_match!(expression, {Áä÷´ pattern1 => result1,Á䔵 pattern2 => result2,ÁT±µ ..Áä¼µ _ => default_result,Á4Ùµ })Á<ൠ```ÁèµËüìµ^[ The final `_ => default_result` arm is required, otherwise the macro will fail to compile.Á˶Ët϶ # ExamplesÁÞ¶Ë\â¶ ```rustÁüî¶-* use bitflags::{bitflags, bitflags_match};Áœ·Ë| · bitflags! {Áä°· #[derive(PartialEq)]ÁÔÍ· struct Flags: u8 {Áìè· const A = 1 << 0;Á솸 const B = 1 << 1;Á줸 const C = 1 << 2;ÁL¸,̸Ò¸ËüÖ¸$! let flags = Flags::A | Flags::B;Áû¸Ëüÿ¸$! // Prints `the value is A and B`Á䤹 bitflags_match!(flags, {ÁüÁ¹@= Flags::A | Flags::B => println!("the value is A and B"),Áü‚º2/ _ => println!("the value is not A and B"),Á<µº });Á½ºËüÁº" // Prints `the value is not A`Áääºø¨ü»/, Flags::A => println!("the value is A"),Áü±»,) _ => println!("the value is not A"),Á<Þ»£ª<滈¤î»Ë”ò» # How it worksÁ…¼Ëü‰¼he The macro expands to a series of `if` statements, **checking equality** between the input expressionÁüò¼eb and each pattern. This allows for correct matching of bitflag combinations, which is not possibleÁüؽLI with a regular match expression due to the way bitflags are implemented.Á¥¾Ëü©¾A> Patterns are evaluated in the order they appear in the macro.Á&|ë¾x$ —¿ ¯Á ¿ È¿, ž¿8 operationÁLŸ¿& ¨¿8ï$©¿$ ­¿ ¯¿ Ç¿, ¹¿ º¿ À¿, »¿8ݽ ¼¿& ½¿8¾¿
Á¿*Ê¿ Í¿ ¬Á ×À ¤ÁØÀ ÛÀ £Á, éÀ8,êÀ'ïÀ8Š„ñÀ Á ‚Á ™Á, ƒÁ8ê¯L„Á$ Á Á ˜Á, ‘Á ’Á •Á, “Á8ݽ ”Á
–Á ¥Á ¦Á% ­Áì÷Áü²Á%" Expand the `bitflags_match` macroÁ¡êÁ íÁ ôÁ8°4îÁtèÁ&|ØÁ‰$ • àÉ Ò •Ã, ÓÂ8ê¯LÔÂ& ÝÂ8ï$ÞÂ$ â ä ”Ã
, æÂ8patternÁ<çÂ& îÂ8ï$ïÂ*ô ÷ †Ã, ù ú ƒÃ, ûÂ8bodyÁ$üÂ& €Ã8Ã
„Ã$ ˆÃ, ŠÃ ‹Ã ‘Ã, ŒÃ8ݽ Ã& ŽÃ8à ’Ã*—à šÃ ôÃ, ¤Ã8,¥Ã'ªÃ8Š„¬Ã ¼Ã ½Ã îÃ, ¾Ã8ê¯L¿Ã$ Èà Êà íÃ, ÌÃ8²´<ÍÃ*Õà ØÃ äÃ, Úà Ûà áÃ, ÜÃ8µ$ÝÃ
âÃ, æÃ çà êÃ, èÃ8ݽ éà ëÃ% õà ©Ä êÄ, ªÄ8ê¯L«Ä& ´Ä8ï$µÄ$ ¹Ä »Ä éÄ , ½Ä8²´<¾Ä& ÅÄ8ï$ÆÄ*ËÄ ÎÄ ÝÄ, ÐÄ ÑÄ ÚÄ, ÒÄ8µ$ÓÄ& ×Ä8ØÄ
ÛÄ, ßÄ àÄ æÄ, áÄ8ݽ âÄ& ãÄ8äÄ çÄ*ìÄ ïÄ ÈÆ ùÄ ÂÆ
8‡Å, ŠÅ8ê¯L‹Å•Å, ˜Å8²´<™Å ¡Å ùÅ84³Å ºÅ êÅ, ÐÅ ÑÅ ×Å, ÒÅ8µ$ÓÅ
ØÅ% ëÅ, ˆÆ8,‰Æ'ŽÆ8ŠÆ  Æ ¡Æ ¸Æ, ¢Æ8ê¯L£Æ$ ¬Æ ®Æ ·Æ, °Æ ±Æ ´Æ, ²Æ8ݽ ³Æ µÆ% ÉÆ ÿÆ ¼Ç, €Ç8ê¯LÇ& ŠÇ8ï$‹Ç$ Ç ‘Ç »Ç
, “Ç8²´<”Ç& ›Ç8ï$œÇ*¡Ç, ¤Ç8µ$¥Ç& ©Ç8ï$ªÇ$ ¯Ç, ±Ç ²Ç ¸Ç, ³Ç8ݽ ´Ç& µÇ8¶Ç ¹Ç*¾Ç ÁÇ îÈ ËÇ èÈ
8ÙÇ, ÜÇ8ê¯LÝÇçÇ, êÇ8²´<ëÇ óÇ ŸÈ84…È, ŒÈ8µ$È% ‘È, ®È8,¯È'´È8Š„¶È ÆÈ ÇÈ ÞÈ, ÈÈ8ê¯LÉÈ$ ÒÈ ÔÈ ÝÈ, ÖÈ ×È ÚÈ, ØÈ8ݽ ÙÈ ÛÈ% ïÈ ”É ÂÉ, •É8ê¯L–É& ŸÉ8ï$ É$ ¤É ¦É ÁÉ 8 ¨É*ªÉ, ­É8><®É& µÉ8ï$¶É, »É ¼É ¾É$ ½É- ¿É*ÄÉ ÇÉ ÞÉ, ÑÉ8><ÒÉüäÍ'üãÉRO A macro that processed the input to `bitflags!` and shuffles attributes aroundÁü¶Ê63 based on whether or not they're "expression-safe".ÁíÊËüñÊ>; This macro is a token-tree muncher that works on 2 levels:Á°ËËü´ËVS For each attribute, we explicitly match on its identifier, like `cfg` to determineÁü‹Ì;8 whether or not it should be considered expression-safe.ÁÇÌËüËÌTQ If you find yourself with an attribute that should be considered expression-safeÁü Í$! and isn't, it can be added here.Á¡×Í ÚÍ áÍ8°4ÛÍtÕÍ&|ÅÍš$ ŒÎ ›á ŽÏ ÑÏ, ˜Ï ™Ï ¶Ï+ šÏ ›Ï µÏ, œÏ8 ,Ï& ¢Ï8Û,£Ï, ©Ï ªÏ ³Ï, «Ï8þ$¬Ï& °Ï8±Ï
´Ï
·Ï ÁÏ ËÏ, ÃÏ8¿ ÄÏ& ÅÏ8ï$ÆÏ*ÓÏ ÖÏ ™Ò, àÏ8,áÏ'æÏ8¡ÔèÏ ‚Ð „Ð “Ò8ï$’Ð& –Ð ˜Ð Ð, šÐ8¿ ›Ð$ žÐ8attrsÁ,¬Ð& ±Ð ³Ð ˆÒ8 unprocessedÁ\òÐ& ýÐ ÿÐ —Ñ, €Ñ Ñ •Ñ+ ‚Ñ ƒÑ ”Ñ, „Ñ8 ,…Ñ, ‹Ñ ŒÑ ’Ñ, Ñ8þ$ŽÑ
“Ñ
–Ñ$ ˜Ñ8 processedÁLíÑ& öÑ øÑ ùÑ$ úÑ$ ‰Ò% šÒ Ô šÖ8ï$§Ô& «Ô ­Ô ·Ô, ¯Ô8¿ °Ô& ±Ô8ï$²Ô$ ¸Ô8ÉË,ÆÔ& ËÔ ÍÔ “Ö8ñË\ÛÔ& æÔ èÔ áÕ+ žÕ ŸÕ °Õ8¢ Õ, ¤Õ ¥Õ ®Õ, ¦Õ8þ$§Õ& «Õ8¬Õ
¯Õ, ÂÕ ÃÕ ÒÕ, ÄÕ8
attrs_restÁTÅÕ& ÏÕ8ÐÕ
2026-01-24 22:59:20 +00:00
ÓÕ$ âÕ8¤ÍLðÕ& ùÕ ûÕ ˆÖ, üÕ ýÕ †Ö, þÕ8ï$ÿÕ& ƒÖ8„Ö
‡Ö$ ‰Ö$ ”Ö*œÖ ŸÖ ŠÙ, ©Ö8,ªÖ'¯Ö8¡Ô±Ö ËÖ ÍÖ „Ù8ï$ÛÖ& ßÖ áÖ æÖ, ãÖ8¿ äÖ$ çÖ8ÉË,õÖ& úÖ üÖ ùØ8ñË\Ž×& ™× ›× Ñ×, ±× ²× ¾×, ³×8›ÐT´×
¿×$ Ò×8¤ÍLä×& í× ï× êØ, …Ø †Ø ŒØ, ‡Ø8ï$ˆØ
Ø+ ÉØ ÊØ ØØ8¢ËØ, ÏØ ÐØ ÖØ, ÑØ8þ$ÒØ
ר$ ëØ$ úØ% ‹Ù ŽÚ —Ü8ï$˜Ú& œÚ žÚ ¨Ú,  Ú8¿ ¡Ú& ¢Ú8ï$£Ú$ ©Ú8ÉË,·Ú& ¼Ú ¾Ú Ü8ñË\ÌÚ& ×Ú ÙÚ ÞÛ+ ’Û “Û ­Û, ”Û8î ,•Û& šÛ8Û,›Û, ¡Û ¢Û «Û, £Û8þ$¤Û& ¨Û8©Û
¬Û, ¿Û ÀÛ ÏÛ, ÁÛ8›ÐTÂÛ& ÌÛ8ÍÛ
ÐÛ$ ßÛ8¤ÍLíÛ& öÛ øÛ …Ü, ùÛ úÛ ƒÜ, ûÛ8ï$üÛ& €Ü8Ü
„Ü$ †Ü$ ‘Ü*™Ü œÜ íÞ, ¦Ü8,§Ü'¬Ü8¡Ô®Ü ÈÜ ÊÜ çÞ8ï$ØÜ& ÜÜ ÞÜ ãÜ, àÜ8¿ áÜ$ äÜ8ÉË,öÜ& ûÜ ýÜ ÜÞ8ñË\Ý& šÝ œÝ ÒÝ, ²Ý ³Ý ¿Ý, ´Ý8›ÐTµÝ
ÀÝ$ ÓÝ8¤ÍLåÝ& îÝ ðÝ ÍÞ, ³Þ ´Þ ºÞ, µÞ8ï$¶Þ
»Þ$ ÎÞ$ ÝÞ% îÞ Äß Üà8ï$Îß& Òß Ôß Þß, Öß8¿ ×ß& Øß8ï$Ùß$ ßß8ÉË,éß& îß ðß Õà8ñË\þß& ‰à ‹à Œà$ à8¤ÍL›à& ¤à ¦à Êà, §à ¨à Èà+ ©à ªà Çà, «à8ï$¬à& °à8Û,±à, ·à ¸à Åà, ¹à8exprargsÁDºà& Âà8Ãà
Æà
Éà$ Ëà$ Öà*Þà áà ™á, ëà ìà ƒá+ íà îà ‚á, ïà8ï$ðà, õà öà €á, ÷à8úÞDøà
á
„á Žá “á, á8¿ ‘áäðáüžá2/ Implement a flag, which may be a wildcard `_`.Á¡ãá æá íá8°4çátáá&|Ñá«$ â ãä “â ’ã â Œã 8ÿ
$«â& ¯â8 ±â$ ²â8namedÁ,Àâ& Åâ Çâ ×â, Éâ Êâ Ôâ, Ëâ8Ãâ,Ìâ& Ñâ8Òâ
Õâ$ Øâ8unnamedÁ<æâ& íâ ïâ ã, ñâ òâ þâ, óâ8»ã<ôâ& ûâ8üâ
ÿâ$ ‚ã*”ã —ã ²ã, ¡ã ¢ã «ã, £ã8»ã<¤ã
¬ã% ³ã ¹ã Âä Ãã ¼ä8ÿ
$Ñã& Õã, ×ã8á$Øã& Üã8Û,Ýã$ âã8Ãâ,ðã& õã ÷ã ‡ä, ùã úã „ä, ûã8Ãâ,üã& ä8‚ä
…ä$ ˆä8»ã<–ä& ä Ÿä ±ä, ¡ä ¢ä ®ä, £ä8»ã<¤ä& «ä8¬ä
¯ä$ ²ä*Ää Çä àä, Ñä Òä Ùä, Óä8Ãâ,Ôä
2026-01-24 22:59:20 +00:00
Úä% áäTóä4÷äüè&ü¹,) Declare the user-facing bitflags struct.ÁæËüê^[ This type is guaranteed to be a newtype with a `bitflags`-facing type as its single field.Á¡Û Þ å8°&|ɼ$  ì  ä , Ÿ   ¯+ ¡ ¢ ®, £8‚º& ©8«

°, º8¬»& ¾8¬¿8, Ê8¸ã& Ù8Û*æ é é
, ó ô þ+ õ ö ý, ÷8‚º
ÿ, 8¬Š8, 8¸ãt– ¤ â
 ¥, ¦8¸ã8, ¹8'¿8Ž'Ê8ü ×'Ø8% ã% êüé+üïB? Implement functions on the public (user-facing) bitflags type.Á²Ëü¶^áÞü•4Èß¡Ü ß æ8°&|ÊÌ$    ú, ¥ ¦ µ+ § ¨ ´, ©8‚º& ¯8«

, À8¸ã& Ï8Û& Õ, ×8 Ø& Ù8Ú$ Ü, Þ8ÅÆ„ß& ï8Û*ü ÿ ˆ, 8'8ß|   ¢ 8Èà& 8$¸$ ¼8Ó$ Â8ÿ
$ È8î $ Ï8˜% Ö, ä å ï+ æ ç î, è8‚º
2026-01-24 22:59:20 +00:00
ð, þ8¸ãtÿ& , 8   øP8 ¤ 8¤ ¬  ­  ¯  ö 8 É  ä , Ê 8ÅÆ„Ë 'Û 8¤ â  ã 8 
8àŒ



 ×
8
 ¬
 Å
, ­
8ÅÆ„®
'¾
8àÀ
 Ã
 Ä
8 ê
8Ó
 ñ
2026-01-24 22:59:20 +00:00
 ÷
 ò
8
 ù
 ­ 8$  7ì  8Ó$–  š  8 À 8Þ  Ì  Ñ 8Ó  Ó  ¼8 , ï 8ÅÆ„ð ' 8ÞL   8Ó   ª6, ¬ 8,­ '² 8ŽL´ '½ 8³$¿ 'à 8ä 'Ë 8Ó 'Ó 8  Ù  Þ 8Ó *à , ã 8 'é 8Ž 'ô 8³ 'ú 8ä '
8Ó4„
'Š
8


8$

 š
8Ó$
$ œ
,
8
'¼
8Ž
'Ç
8³
2026-01-24 22:59:20 +00:00
'Í
8ä
'Õ
8Ó4×
'Ý
8Ð
*ä
, ç
2026-01-24 22:59:20 +00:00
8
'í
8Ž
'ø
8³
'þ
8ä 4€'8Ó4ˆ'Ž8Ð$$ 8 Ï8î”Ò ä é8Ó ë Ã8$  ±, 8ÅÆ„‡'8î”™ « °8Ó8 Ö8„Ù é î8Ó ð Æ8$† Š ´, 8ÅÆ„Œ'œ8„ž ® ³8Ó8 Ù8ž å ê8ÿ
 ì Õ8,‚, ˆ8ÅÆ„‰'8žL ¤ ©8ÿ
 « Ã6, Å8'Ë8Ž'Ö8³'Ü8ä 'ä8Ó'ì8 ò ÷8Ó*ù, ü8'8ŽL„'8³$'8ä 4•'8Ó4'£8 © ´8 ® ³8Ó$ µ, Ï8'Õ8ŽL×'à8³'æ8ä 'î8Ó'ö8Ð*ý, 8,'8ŽLˆ'8³$“'8ä 4™'Ÿ8Ó'§8Ð$ ­8 è8ß ó ù ô8 û ³8$‘ 7ì  8ß   ¡8 Æ8î Ï Õ Ð8 × 8 ñ7ì ò ó8î ú û8  8û ­ º ®8$ ³8î  ¼ ý8 Ö7ì × Ø8û ã ë8î  é7ì ê8 8ŒD“  ¨ œ8$$ ¡8î  ª é8 Ä7ì Å Æ8Œ Ï ×8î  Õ7ì Ö8 ü8ª4ÿ   88$$ 8î ,‘ ˜ Õ8 ²7ì ³ ´8ª » Ã8î  Á7ì Â8 è8· ñ  ò8ó8$ û8î   Á8 ž7ì Ÿ  8· § ¯8î  ­7ì ®8 Ô8Ä Ý î Þ8ß8$ ç8î  ð ­8$† Š7ì  Œ8Ä4  8î ,” 7ì š8 À8ÑÃ Æ Þ Ç8È8$ Ð8î $ ×8˜ à ¡8 ú7ì û ü8Ñý  8î , 7ì $ ˆ8˜8 ´8ç à Ï8$ È8î  Ñ š8 ë ˆ8 ð7ì ñ ò8ç ÿ 8î ,€ 7ì 8 ­8C µ Á8$ º8î  Ã 8 Ý ó8 â7ì ã ä8C ê ò8î  ð7ì ñ8 ˜8T› ¥ ±8$ ª8î  ³ ú8 Í è8 Ò7ì Ó Ô8 ß ç8î  å7ì æ8 8¤ ¤ °8$ ©8î  ² ƒ8 Ì ñ8 Ñ7ì Ò Ó8¤Ô è ð8î  î7ì ï8 8¬T™ £ ¨8 ª ê8 Ä Ø8 É7ì Ê Ë8¬ Ö ×% üˆ!#üŽBìíÑËüÕ^áÞü´ 4Èß¡û  þ  …!8°4ÿ &|é Ü$ ¬! E ²! #, ¼! ½! Ì!+ ¾! ¿! Ë!, À!8‚º,Á!& Æ!8«
$Ç!
Í!, ×!8¦DØ!& à!8Û,á!& æ!, è!8 é!& ê!8ë!$ í!, ï!8¸ãtð!& þ!8Û,ÿ! …" Œ#, “" ”" #, ¦" §" Ä"+ ¨" ©" Ã", ª"8 ,«"& °"8Û,±", ·" ¸" Á", ¹"8þ$º"& ¾"8¿"
Â"
Å"8,×", Ý"8á$Þ"& â"8ã" æ", è"8˜,é"& î"8ï$ï"% ó"
#*”# —# ŠE, ¡#8,¢#'§#8ß|©# ¸# º# „E8Èà4È#& Î#8$Ð#$ Ô#8Ó$Ö#$ Ú#8ÿ
$Ü#$ à#8î ,â#$ ç#8˜,é#% î#, ü# ý# ‡$+ þ# ÿ# †$, €$8‚º,$
2026-01-24 22:59:20 +00:00
ˆ$, $8¦D—$& Ÿ$, ¡$8 ¢$ ¤$ úDP8 ¶$8¤,¹$ ¾$ ¿$ Á$ ‰%8$×$ Û$ ÷$  Ü$, Ý$8 Þ$8à$, ã$8,ä$'é$8$ë$ ï$'ð$8Å,ò$8 œ%8àŸ% ¢% £% ¥% «* 8»%8¿%8 truncatedÁLÃ% Í% Ï%, Ð%8 Ñ%8Ó%, Ö%8,×%'Ü%8$Þ% â%'ã%8Å,å%% ê%8€&8„&8» ˆ& Š&7ì Œ&% &, ¤& ¥& Ô), ¿&8,À&'Å&8¡ÔÇ& á& â& ½), €' ' •'+ ' ƒ' ”', „'8 ,…', ' Œ' ', '8þ$Ž'
“'
' ´' £) µ' ¢) 8×'8‰»$Û' à' â', ã'8¸ãtä'8ó', ö'8,÷''ü'8,þ' ƒ('„(8,†( ( (8» Œ( Ž(8˜,( ”( •( (8Ó$—( ( œ(% (8¯LÀ( Ê(8¯LÌ( Ö(8‰»$Ø(% Ü(8» þ(€)7í ƒ)% „)% ¾)
Õ)8ì)8 ð) ò)8» ô)% õ)8$* * ™*8¯L*8 ¾*8Ó$Á* Å* Ë* Æ*8$Ç* Í* ú*8$ã* ç*7ì è*8 +8ÞL+ ™+ ž+8Ó$š+  + ï-8¶+8¯Lº+ Ä+8$Æ+'Ê+8î”Ì+ Þ+ ã+8Ó$ß+ ä+7ì å+% æ+8ý+8¯L€,Š,8Ó$, , ú,
, ¬,8,­,'²,8ŽL´,'½,8³$¿,'Ã,8ä 4Å,'Ë,8Ó4Í,'Ó,8$Õ, Ù, ä,8$Ú, Þ, ã,8Ó$ß,8$ü, - Ý- , -8,œ-'¡-8ŽL£-'¬-8³$®-'²-8ä 4´-'º-8Ó4¼-'Â-8Ð$Ä-8 .8î”…. —. œ.8Ó$˜. ž. ß.8$´. ¸. Í.8Ó$¹. ¾.8$À.'Ä.8àÆ. É. Ê. Ë.7ì Ì.8 ò.8„õ. …/ Š/8Ó$†/ Œ/ ½/8$¢/ ¦/ «/8Ó$§/8 Ð/8žLÓ/ Ü/ á/8ÿ
$Ý/ ã/ î6, ù/ ú/ ö5, ”08,•0'š08Â|œ0 «0 ¬0 ß5 ­0 Þ5
8ÿ
$Ë0& Ï0, Ñ08á$Ò0$ Ö08Ãâ,ô0& ù0 û0 š5, 18,ž1'£18¡Ô¥1 ¿1 À1 û4, æ1 ç1 û1+ è1 é1 ú1, ê18 ,ë1, ñ1 ò1 ø1, ó18þ$ô1
ù1
ü1 ¢2 Ù48Ì28ÿ
$Ï2Ô2, ×28,Ø2'Ý28ŽLß2'è28³$ê2'î28µLð2 ù2 ú2 €3, û28á$ü2 3 ³484°3, ·38,¸3'½38ŽL¿3'È38³$Ê3'Î38ä 4Ð3'Ö38Ó4Ø3'Þ38$à3 ä3 ˆ48$å3 é3 ‡4, ê38¸ãtë3'ù3, û38á$ü3 €48Ó$4 …4 †4% ‰4% ü4$ 58»ã<¹5& À5 Â5 Ã5$ Ä5% à5
÷58Ž68 6 ”68ÿ
$6% š6, °68,±6'¶68ŽL¸6'Á68³$Ã6'Ç68ä 4É6'Ï68Ó4Ñ6'×68Ð$Ù68 78ßD„7 Œ7 7 78$Ž7 ”7 à78$ª7 ®77ì ¯7±7 ´7, µ78 ¶78¸7, »78,¼7'Á78$Ã7 Ç7'È78Å,Ê78 ó78î4ö7 ü7 8 ý78$þ7 „8 ê98$¹9'½98à¿9 Â9 Ã9 Ä97ì Å9 Ç98$É9 Í97ì Î9Ð98$Ó9 ×97ì Ø98 ý98ûT€: Š: —: :8$Œ:$ :8î ,: ™: ï:8$¯: ³:7ì ´: ¶:8î ,¸: ½:7ì ¾:À: Ã:, Ä:8 Å:8Ç:, Ê:8,Ë:'Ð:8$Ò: Ö:'×:8Å,Ù:8 ;8ŒD…; ; š; Ž;8$;$ “;8î ,•; œ; Þ; 8$²; ¶;7ì ·; ¹;8î ,»; À;7ì Á;Ã;8î ,Æ; Ë;7ì Ì;8 ñ;8ª4ô; ú; < û;8ü;8$€<$ „<8î ,†< < Ö<
£<8$¤< ©<8$«< ¯< ¶<8$°< ´<7ì µ< ·<8C,¸< ½< Ã<8î ,¾<% Ä<8 é<8·4ì< ò< ƒ= ó<8ô<8$ø<$ ü<8î ,þ< …= Ó=
=8$œ= ¡=8$£= §= ®=8$¨= ¬=7ì ­= ¯=8T°= º= À=8î ,»=% Á=8 æ=8Ä4é= ï= €> ð=8ñ=8$õ=$ ù=8î ,û= > Ú>
˜>8$™> ž>8$ > ¤> «>8$¥> ©>7ì ª> ¬>8¤­> Á> Ç>8î ,Â>% È>8 í>8Ñð> ó> ? ô>8õ>8$ù>$ ý>8î ,ÿ>$ „?8˜,†? ? É@8£?8˜,¦? ¬? î?8$Æ? Ê?8ª4Ë? Ñ? ×?8î ,Ò?% Ø?8$ð? õ? ·@8$@ “@8·4”@ š@  @8î ,@% ¡@8 Ü@8çdß@ ë@ ÷@8$ì@$ ð@8î ,ò@ ù@ ¶A8$A “A ¤A8$”A ˜A7ì ™A A8î ,A ¢A7ì £A8 ÉA8C,ÌA ÑA ÝA8$ÒA$ ÖA8î ,ØA ßA œB8$õA ùA ŠB8$úA þA7ì ÿA B8î ,ƒB ˆB7ì ‰B8 ¯B8T²B ¼B ÈB8$½B$ ÁB8î ,ÃB ÊB ˆC8$àB äB öB8$åB éB7ì êB ìB îB8î ,ïB ôB7ì õB8 ›C8¤žC ²C ¾C8$³C$ ·C8î ,¹C ÀC ýC8$ÖC ÚC ëC8$ÛC ßC7ì àC âC8î ,äC éC7ì êC8 D8¬T“D D ¢D8$žD ¤D ìD8$ºD'¾D8î”ÀD ÒD ÚD ÓD8$ÔD ØD7ì ÙD% EüòE(üEB? Implement iterators on the public (user-facing) bitflags type.Á¡åE èE ïE8°4éEtãE&|ÓEì$ F šT ¡F øF, «F ¬F »F+ ­F ®F ºF, ¯F8‚º,°F& µF8«
$¶F
¼F, ÆF8¦DÇF& ÏF8Û,ÐF& ÕF, ×F8 ØF& ÙF8ÚF$ ÜF, ÞF8¸ãtßF& íF8Û,îF*úF ýF —T, ‡G ˆG G+ ‰G ŠG G, G8‚º,ŒG
“G8$G, ¢G8¦D£G ¬G ÚQ.<³âüºG*<ËñG<ñâüHV<ÐãüäH4+ ¥I ¦I ­I8þ4§I8»I8,¿I8 ÅI8£ $ÈI ÌI ÒI ÍI8$ÎI(ÔI, ×I8,ØI'ÝI8£ $ßI'ãI8þ $åI éI, êI8¸ãtëI ùI ûI L , J8,ŽJ'“J8£ $•J'™J8þ $J'ŸJ8Å œ¡J ´J L ÊJ, ËJ8¸ãtÌJ8ÛJ, ÞJ8,ßJ'äJ8,æJ ëJ'ìJ8,îJ$ óJ, ‰K8¸ãtŠK'˜K8„šK ªK ¶K8$«K ¯K8Ó$°K ´K µK$ ·K, ÍK8¸ãtÎK'ÜK8„ÞK îK úK8$ïK óK8Ó$ôK øK ùK$ ûK<–åüªL0<ËçL<^ This method is like [`iter`](#method.iter), except only yields bits in contained named flags.Áü÷La<½æüåMX+ ÊN ËN ÒN8þ4ÌN8àN8,äN8 êN8µTíN ÷N ýN øN8$ùN(ÿN, O8,ƒO'ˆO8£ $ŠO'ŽO8ø LO ™O, šO8¸ãtO ©O «O ÐQ , ½O8,¾O'ÃO8£ $ÅO'ÉO8ø LËO'ÔO8Å œÖO éO ÂQ ÿO, €P8¸ãtP8P, “P8,”P'™P8,P  P'¡P8,£P$ ¨P, ¾P8¸ãt¿P'ÍP8„ÏP ßP ëP8$àP äP8Ó$åP éP êP$ ìP, Q8¸ãtƒQ'Q8„“Q £Q ¯Q8$¤Q ¨Q8Ó$©Q ­Q ®Q$ °Q, åQ æQ õQ+ çQ èQ ôQ, éQ8‚º,êQ& ïQ8«
$ðQ
öQ8$€R, …R8,†R'R8ŽLR'R8³$˜R'œR8£ $žR'¢R8²d¤R8
±R, µR8¦D¶R ¿R T8!$ÍR8½$ÒR ×R, ÙR8¸ãtÚR% èR8!$öR8IntoIterÁDûR „S, †S8,‡S'ŒS8£ $ŽS'S8þ $”S ˜S, ™S8¸ãtšS ¨S% ©S8 ¸S8Š L»S ÄS ÉS8$ÅS(ËS8$ÎS'ÒS8üÖDÔS ÝS ‡T8$ïS óS8£ $ôS øS ùS% ˜TüüT'üT?< Implement traits on the public (user-facing) bitflags type.Á¡ïT òT ùT8°4óTtíT&|ÝTü$ ¤U ׄ ªU éU, ´U µU ÄU+ ¶U ·U ÃU, ¸U8‚º,¹U& ¾U8«
$¿U
2026-01-24 22:59:20 +00:00
ÅU, ÏU8¸ãtÐU& ÞU8Û,ßU*ëU îU Ô„, ùU úU „V+ ûU üU ƒV, ýU8‚º,þU
…V8$V, ”V8,•V'šV8ŽLœV'¥V8³$§V'«V8Í­V'°V8BinaryÁ4²V8
¹V, ½V8¸ãt¾V ÍV òX8 ÛV8ÍÞV áV ÇW óV8$ôV$ øV8þ ŠW& W W8ŽW, W8,“W'˜W8ŽLšW'£W8³$¥W'©W8Í«W'®W8œL°W$ ¹W(ÉW, ÌW8,ÍW'ÒW8ŽLÔW'ÝW8³$ßW'ãW8ÍåW'èW8ý4êW ñW èX8ƒX8 ,‡X X8$X “X7ì ”X% •X, §X8,¨X'­X8ŽL¯X'¸X8³$ºX'¾X8ÍÀX'ÃX8¿Ü4ÅX'ËX8ÍÍX ÐX ÚX ÑX8 ,ÒX$ ×X8þ ÙX, ýX þX ˆY+ ÿX €Y ‡Y, Y8‚º,Y
‰Y8$“Y, ˜Y8,™Y'žY8ŽL Y'©Y8³$«Y'¯Y8ͱY'´Y8OctalÁ,¶Y8
¼Y, ÀY8¸ãtÁY ÐY ô[8 ÞY8ÍáY äY ÊZ öY8$÷Y$ ûY8þ Z& ŽZ Z8Z, •Z8,Z'Z8ŽLZ'¦Z8³$¨Z'¬Z8Í®Z'±Z8œL³Z$ ¼Z(ÌZ, ÏZ8,ÐZ'ÕZ8ŽL×Z'àZ8³$âZ'æZ8ÍèZ'ëZ8ý4íZ ôZ ê[8†[8 ,Š[ [8$[ [7ì —[% ˜[, ª[8,«['°[8ŽL²['»[8³$½['Á[8ÍÃ['Æ[8›â,È['Í[8ÍÏ[ Ò[ Ü[ Ó[8 ,Ô[$ Ù[8þ Û[, ÿ[ €\ Š\+ \ \ ‰\, ƒ\8‚º,„\
\8$•\, š\8,\' \8ŽL¢\'«\8³$­\'±\8ͳ\'¶\8LowerHexÁD¸\8
Á\, Å\8¸ãtÆ\ Õ\ ü^8 ã\8Íæ\ é\ Ï] û\8$ü\$ €]8þ ]& “] •]8], š]8,]' ]8ŽL¢]'«]8³$­]'±]8ͳ]'¶]8œL¸]$ Á](Ñ], Ô]8,Õ]'Ú]8ŽLÜ]'å]8³$ç]'ë]8Íí]'ð]8ý4ò] ù] ò^8^8 ,^ •^8$—^ ^7ì œ^% ^, ¯^8,°^'µ^8ŽL·^'À^8³$Â^'Æ^8ÍÈ^'Ë^8öçDÍ^'Õ^8Í×^ Ú^ ä^ Û^8 ,Ü^$ á^8þ ã^, ‡_ ˆ_ _+ ‰_ Š_ _, _8‚º,Œ_
“_8$_, ¢_8,£_'¨_8ŽLª_'³_8³$µ_'¹_8Í»_'¾_8UpperHexÁDÀ_8
É_, Í_8¸ãtÎ_ Ý_ „b8 ë_8Íî_ ñ_ ×` ƒ`8$„`$ ˆ`8þ š`& ` `8ž`, ¢`8,£`'¨`8ŽLª`'³`8³$µ`'¹`8Í»`'¾`8œLÀ`$ É`(Ù`, Ü`8,Ý`'â`8ŽLä`'í`8³$ï`'ó`8Íõ`'ø`8ý4ú` a úa8“a8 ,—a a8$Ÿa £a7ì ¤a% ¥a, ·a8,¸a'½a8ŽL¿a'Èa8³$Êa'Îa8ÍÐa'Óa8ÔíDÕa'Ýa8Íßa âa ìa ãa8 ,äa$ éa8þ ëa, b b šb+ b b ™b, “b8‚º,”b
b8$¥b, ªb8,«b'°b8ŽL²b'»b8³$½b'Áb8Þ Ãb'Æb8¼À,Èb8
Îb, Òb8¸ãtÓb âb Öd8!$ðb8Ø4õb üb8$þb% c<±ðü‘c9+ ×c Øc ßc8þ4Ùc8 íc8í,ðc õc d8$öc$ úc8î ,üc& d, ƒd8¸ãt„d(”d8$—d œd Ìd8$®d ²d8C,³d ¸d ¾d8î ,¹d, ád âd ìd+ ãd äd ëd, åd8‚º,æd
íd8$÷d, üd8,ýd'e8ŽL„e'e8³$e'“e8Þ •e'˜e8 BitOrAssignÁ\še8
¦e, ªe8¸ãt«e ºe ˆg<±ðüÈe9+ Žf f f8þ4f8 ¤f8îd§f ³f Êf ´f8µf8$¹f$ ½f8î ,¿f& Äf8$Æf Ìf þf8$Þf âf8ª4ãf éf ïf8î ,êf% ðf, “g ”g žg+ •g g g, —g8‚º,˜g
2026-01-24 22:59:20 +00:00
Ÿg8$©g, ®g8,¯g'´g8ŽL¶g'¿g8³$Ág'Åg8Þ Çg'Êg8ÔÀ4Ìg8