Trait MmioSplit

Source
pub trait MmioSplit: Mmio + Sized {
    // Required method
    fn try_split_off(&mut self, mid: usize) -> Result<Self, MmioError>;

    // Provided method
    fn split_off(&mut self, mid: usize) -> Self { ... }
}
Expand description

An MMIO region from which ownership of disjoint sub-regions can be split off.

Required Methods§

Source

fn try_split_off(&mut self, mid: usize) -> Result<Self, MmioError>

Splits this Mmio region into two at the given mid-point and returns the left-hand-side. This MMIO region’s bounds are updated to contain only the right-hand-side.

§Errors

Provided Methods§

Source

fn split_off(&mut self, mid: usize) -> Self

Splits this MMIO region into two at the given mid-point and returns the left-hand-side. This MMIO region’s bounds are updated to contain only the right-hand-side.

§Panics
  • If mid > self.len().

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<Impl: UnsafeMmio, Owner: Borrow<Impl> + Clone> MmioSplit for MmioRegion<Impl, Owner>