pub struct EventMask(/* private fields */);Expand description
A set of pending EventFlags conditions.
The representation is exactly one u32: bit indices 0 through 31 are the
complete condition namespace. Applications can define named const masks
with EventMask::from_bits without introducing a runtime mapping layer.
Implementations§
Source§impl EventMask
impl EventMask
Sourcepub const fn from_bits(bits: u32) -> Self
pub const fn from_bits(bits: u32) -> Self
Construct a mask from its exact 32-bit representation.
Sourcepub const fn from_index(index: u32) -> Option<Self>
pub const fn from_index(index: u32) -> Option<Self>
Construct the one-condition mask at index.
Returns None for an index outside 0..32; no shift panic is
reachable, including on a hot path that validates external input.
Sourcepub const fn contains(self, other: Self) -> bool
pub const fn contains(self, other: Self) -> bool
Whether every condition in other is present in this set.
Sourcepub const fn intersects(self, other: Self) -> bool
pub const fn intersects(self, other: Self) -> bool
Whether this set and other share at least one condition.
Trait Implementations§
Source§impl BitOrAssign for EventMask
impl BitOrAssign for EventMask
Source§fn bitor_assign(&mut self, rhs: Self)
fn bitor_assign(&mut self, rhs: Self)
Performs the
|= operation. Read moreimpl Copy for EventMask
impl Eq for EventMask
impl StructuralPartialEq for EventMask
Auto Trait Implementations§
impl Freeze for EventMask
impl RefUnwindSafe for EventMask
impl Send for EventMask
impl Sync for EventMask
impl Unpin for EventMask
impl UnsafeUnpin for EventMask
impl UnwindSafe for EventMask
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