pub trait EventMask: Copy + 'static {
// Required method
fn as_bits(self) -> u32;
}
Expand description
Definition of event bits.
Implementors should be simple wrappers around u32
that allow application code to clearly
differentiate the relevant event sources. Events and signals correspond to the bits of the
value returned by as_bits()
.
§Examples
use bitflags::bitflags;
bitflags! {
struct Ev: u32 {
const USB_RX = 1 << 0;
const PRIO = 1 << 1;
const TICK = 1 << 2;
}
}
impl EventMask for Ev {
fn as_bits(self) -> u32 {
self.bits()
}
}
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.