Struct vach::prelude::Flags [−][src]
pub struct Flags { /* fields omitted */ }
Expand description
Abstracted flag access and manipulation struct
.
A “mini-bitflags” of sorts.
Implementations
The flags used within the library, therefore interaction is disallowed. Any interaction with set will cause an exception.
The flag that represents compressed sources
The flag that represents sources with signatures
Returns a error if mask contains a reserved bit.
Set a flag into the underlying structure.
The toggle
parameter specifies whether to insert the flags (when true), or to pop the flag, (when false).
use vach::prelude::Flags;
let mut flag = Flags::from_bits(0b0000_0000_0000_0000);
flag.set(0b0000_1000_0000_0000, true);
flag.set(0b0000_0000_1000_0000, true);
assert_eq!(flag.bits(), 0b0000_1000_1000_0000);
// --------------------------v---------
flag.set(0b0000_1000_0000_0001, false); // 0 flags remain zero
assert_eq!(flag.bits(), 0b0000_0000_1000_0000);
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Flags
impl UnwindSafe for Flags
Blanket Implementations
Mutably borrows from an owned value. Read more