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)); // UnknownTrait Implementations§
Source§impl Clone for InvalidBits
impl Clone for InvalidBits
Source§fn clone(&self) -> InvalidBits
fn clone(&self) -> InvalidBits
Returns a duplicate 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 Error for InvalidBits
Available on crate feature std only.
impl Error for InvalidBits
Available on crate feature
std only.1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
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