kernel::io

Trait IoCapable

Source
pub trait IoCapable<T>: IoBackend {
    // Required methods
    fn io_read<'a>(view: Self::View<'a, T>) -> T;
    fn io_write<'a>(view: Self::View<'a, T>, value: T);
}
Expand description

Trait indicating that an I/O backend supports operations of a certain type and providing an implementation for these operations.

Different I/O backends can implement this trait to expose only the operations they support.

For example, a PCI configuration space may implement IoCapable<u8>, IoCapable<u16>, and IoCapable<u32>, but not IoCapable<u64>, while an MMIO region on a 64-bit system might implement all four.

Required Methods§

Source

fn io_read<'a>(view: Self::View<'a, T>) -> T

Performs an I/O read of type T at view and returns the result.

Source

fn io_write<'a>(view: Self::View<'a, T>, value: T)

Performs an I/O write of value at view.

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§