Trait kernel::io::IoKnownSize

source ·
pub trait IoKnownSize: Io {
    const MIN_SIZE: usize;

    // Provided method
    fn io_addr_assert<U>(&self, offset: usize) -> usize { ... }
}
Expand description

Trait for types with a known size at compile time.

This trait is implemented by I/O backends that have a compile-time known size, enabling the use of infallible I/O accessors with compile-time bounds checking.

Types implementing this trait can use the infallible methods in Io trait (e.g., read8, write32), which require Self: IoKnownSize bound.

Required Associated Constants§

source

const MIN_SIZE: usize

Minimum usable size of this region.

Provided Methods§

source

fn io_addr_assert<U>(&self, offset: usize) -> usize

Returns the absolute I/O address for a given offset, performing compile-time bound checks.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<'a, S: ConfigSpaceKind> IoKnownSize for ConfigSpace<'a, S>

source§

const MIN_SIZE: usize = S::SIZE

source§

impl<const SIZE: usize> IoKnownSize for Mmio<SIZE>

source§

const MIN_SIZE: usize = SIZE