kernel::io

Trait IoBase

Source
pub trait IoBase<'a>: Copy {
    type Backend: IoBackend;
    type Target: ?Sized + KnownSize;

    // Required method
    fn as_view(self) -> <Self::Backend as IoBackend>::View<'a, Self::Target>;
}
Expand description

Types implementing this trait (e.g. MMIO BARs or PCI config regions) can perform I/O operations on regions of memory.

This trait defines which backend shall be used for I/O operations and provides a method to convert into IoBackend::View. Users should use the Io trait which provides the actual methods to perform I/O operations.

This should be implemented on cheaply copyable handles, such as references or view types.

Required Associated Types§

Source

type Backend: IoBackend

Type that defines all I/O operations.

Source

type Target: ?Sized + KnownSize

Type of this I/O region. For untyped regions, Region can be used.

Required Methods§

Source

fn as_view(self) -> <Self::Backend as IoBackend>::View<'a, Self::Target>

Return a view that covers the full region.

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§

Source§

impl<'a, D, R, const SIZE: usize> IoBase<'a> for &'a VMap<D, R, SIZE>
where D: DriverObject, R: Deref<Target = Object<D>>,

Source§

impl<'a, T: ?Sized + KnownSize> IoBase<'a> for &'a Coherent<T>

Source§

impl<'a, T: ?Sized + KnownSize> IoBase<'a> for IoSysMap<'a, T>

Source§

impl<'a, T: ?Sized + KnownSize> IoBase<'a> for CoherentView<'a, T>

Source§

impl<'a, T: ?Sized + KnownSize> IoBase<'a> for ConfigSpace<'a, T>

Source§

type Backend = ConfigSpaceBackend

Source§

type Target = T

Source§

impl<'a, T: ?Sized + KnownSize> IoBase<'a> for Mmio<'a, T>

Source§

impl<'a, T: ?Sized + KnownSize> IoBase<'a> for RelaxedMmio<'a, T>

Source§

impl<'a, T: ?Sized + KnownSize> IoBase<'a> for SysMem<'a, T>

Source§

impl<'a, const SIZE: usize> IoBase<'a> for &'a Bar<'_, SIZE>

Source§

impl<'a, const SIZE: usize> IoBase<'a> for &'a ExclusiveIoMem<'_, SIZE>

Source§

impl<'a, const SIZE: usize> IoBase<'a> for &'a IoMem<'_, SIZE>