pub trait PortAddress: Debug {
const ADDRESS_MASK: u16;
const ADDRESS_BITS: u16;
// Provided method
fn match_port(address: u16) -> bool { ... }
}Expand description
A helper trait for matching I/O port addresses.
Required Associated Constants§
Sourceconst ADDRESS_MASK: u16
const ADDRESS_MASK: u16
Relevant address bits should be set to 1.
Sourceconst ADDRESS_BITS: u16
const ADDRESS_BITS: u16
Bits from this constant will be matching only if ADDRESS_MASK constains 1 for bits in the same positions.
Provided Methods§
Sourcefn match_port(address: u16) -> bool
fn match_port(address: u16) -> bool
Returns true if a provided address masked with ADDRESS_MASK matches ADDRESS_BITS.
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.