pub struct Flags(/* private fields */);Expand description
Frame flags.
Implementations§
Source§impl Flags
impl Flags
Sourcepub const fn from_bits(bits: u8) -> Self
pub const fn from_bits(bits: u8) -> Self
Create a new set of frame flags from bits.
The upper 6 bits of bits are discarded.
Sourcepub const fn is_any_set(self, other: Self) -> bool
pub const fn is_any_set(self, other: Self) -> bool
Check whether any flag in other is set in self.
If other contains only one flag, this method behaves identical to is_all_set().
Sourcepub const fn is_all_set(self, other: Self) -> bool
pub const fn is_all_set(self, other: Self) -> bool
Check whether all flags in other are set in self.
If other contains only one flag, this method behaves identical to is_any_set().
Sourcepub fn set_if<F>(&mut self, other: Self, f: F)
pub fn set_if<F>(&mut self, other: Self, f: F)
Set the flags of other in self if the predicate f returns true.
Sourcepub fn unset_if<F>(&mut self, other: Self, f: F)
pub fn unset_if<F>(&mut self, other: Self, f: F)
Unset the flags of other in self if the predicate f returns true.
Sourcepub fn set_or_unset(&mut self, other: Self, set: bool)
pub fn set_or_unset(&mut self, other: Self, set: bool)
Set or unset the flags of other in self depending on set.
If set is true, this method will set the flags of other in self. If set
is false, it will unset them.
Sourcepub fn set_or_unset_with<F>(&mut self, other: Self, f: F)
pub fn set_or_unset_with<F>(&mut self, other: Self, f: F)
Set or unset the flags of other in self based on a predicate f.
Trait Implementations§
impl Copy for Flags
impl Eq for Flags
impl StructuralPartialEq for Flags
Auto Trait Implementations§
impl Freeze for Flags
impl RefUnwindSafe for Flags
impl Send for Flags
impl Sync for Flags
impl Unpin for Flags
impl UnwindSafe for Flags
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