PortAddress

Trait PortAddress 

Source
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§

Source

const ADDRESS_MASK: u16

Relevant address bits should be set to 1.

Source

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§

Source

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.

Implementors§