pub struct InvalidBits;
Expand description
Error type returned when creating a new flagset from bits is invalid or undefined.
use flagset::{FlagSet, flags};
flags! {
pub enum Flag: u16 {
Foo = 0b0001,
Bar = 0b0010,
Baz = 0b0100,
Qux = 0b1010, // Implies Bar
}
}
assert_eq!(FlagSet::<Flag>::new(0b01101), Err(flagset::InvalidBits)); // Invalid
assert_eq!(FlagSet::<Flag>::new(0b10101), Err(flagset::InvalidBits)); // Unknown
Trait Implementations§
source§impl Clone for InvalidBits
impl Clone for InvalidBits
source§fn clone(&self) -> InvalidBits
fn clone(&self) -> InvalidBits
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for InvalidBits
impl Debug for InvalidBits
source§impl Display for InvalidBits
impl Display for InvalidBits
source§impl PartialEq for InvalidBits
impl PartialEq for InvalidBits
impl Copy for InvalidBits
impl Eq for InvalidBits
impl StructuralPartialEq for InvalidBits
Auto Trait Implementations§
impl Freeze for InvalidBits
impl RefUnwindSafe for InvalidBits
impl Send for InvalidBits
impl Sync for InvalidBits
impl Unpin for InvalidBits
impl UnwindSafe for InvalidBits
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)