pub struct Flag<T: PrimInt> { /* private fields */ }Expand description
§Flag
Flag is used to declare flags
To initialize the flag you need to pass in the flag’s mask and units.
use bitbite::Flag;
struct Header(u8);
impl Header {
pub const FIRST_NIBBLE : Flag<u8> = Flag::new(0b0000_1111);
pub const SECOND_NIBBLE_FIRST_HALF : Flag<u8> = Flag::new(0b0011_0000);
pub const SECOND_NIBBLE_SECOND_HALF : Flag<u8> = Flag::new(0b0011_0000);
}Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Flag<T>where
T: Freeze,
impl<T> RefUnwindSafe for Flag<T>where
T: RefUnwindSafe,
impl<T> Send for Flag<T>where
T: Send,
impl<T> Sync for Flag<T>where
T: Sync,
impl<T> Unpin for Flag<T>where
T: Unpin,
impl<T> UnwindSafe for Flag<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more