pub struct LlamaTokenAttrs(pub BitFlags<LlamaTokenAttr>);
Expand description
A set of LlamaTokenAttrs
Tuple Fields§
§0: BitFlags<LlamaTokenAttr>
Methods from Deref<Target = BitFlags<LlamaTokenAttr>>§
pub const EMPTY: BitFlags<T>
pub const ALL: BitFlags<T>
pub const CONST_TOKEN: ConstToken<T, <T as RawBitFlags>::Numeric>
Sourcepub fn set<B>(&mut self, other: B, cond: bool)
pub fn set<B>(&mut self, other: B, cond: bool)
Inserts if cond
holds, else removes
#[bitflags]
#[derive(Clone, Copy, PartialEq, Debug)]
#[repr(u8)]
enum MyFlag {
A = 1 << 0,
B = 1 << 1,
C = 1 << 2,
}
let mut state = MyFlag::A | MyFlag::C;
state.set(MyFlag::A | MyFlag::B, false);
// Because the condition was false, both
// `A` and `B` are removed from the set
assert_eq!(state, MyFlag::C);
Trait Implementations§
Source§impl Clone for LlamaTokenAttrs
impl Clone for LlamaTokenAttrs
Source§fn clone(&self) -> LlamaTokenAttrs
fn clone(&self) -> LlamaTokenAttrs
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 LlamaTokenAttrs
impl Debug for LlamaTokenAttrs
Source§impl Deref for LlamaTokenAttrs
impl Deref for LlamaTokenAttrs
Source§impl DerefMut for LlamaTokenAttrs
impl DerefMut for LlamaTokenAttrs
Source§impl PartialEq for LlamaTokenAttrs
impl PartialEq for LlamaTokenAttrs
Source§impl TryFrom<u32> for LlamaTokenAttrs
impl TryFrom<u32> for LlamaTokenAttrs
Source§type Error = LlamaTokenTypeFromIntError
type Error = LlamaTokenTypeFromIntError
The type returned in the event of a conversion error.
impl Copy for LlamaTokenAttrs
impl Eq for LlamaTokenAttrs
impl StructuralPartialEq for LlamaTokenAttrs
Auto Trait Implementations§
impl Freeze for LlamaTokenAttrs
impl RefUnwindSafe for LlamaTokenAttrs
impl Send for LlamaTokenAttrs
impl Sync for LlamaTokenAttrs
impl Unpin for LlamaTokenAttrs
impl UnwindSafe for LlamaTokenAttrs
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