pub trait MmioOperand:
BitAnd<Output = Self>
+ BitOr<Output = Self>
+ Not<Output = Self>
+ MmioOperand
+ PartialEq
+ Copy
+ Debug
+ Display
+ Sized {
// Required methods
fn try_load<M: Mmio + ?Sized>(
mmio: &M,
offset: usize,
) -> Result<Self, MmioError>;
fn try_store<M: Mmio + ?Sized>(
mmio: &mut M,
offset: usize,
value: Self,
) -> Result<(), MmioError>;
}Expand description
Implemented for the fundamental types supported by all Mmio implementations.
This is a sealed trait, implemented for the types: u8, u16, u32, u64.
Required Methods§
Sourcefn try_load<M: Mmio + ?Sized>(
mmio: &M,
offset: usize,
) -> Result<Self, MmioError>
fn try_load<M: Mmio + ?Sized>( mmio: &M, offset: usize, ) -> Result<Self, MmioError>
Loads a value of the this type from the MMIO region at the given offset.
§Errors
- MmioError::OutOfRange: if the load would exceed the bounds of this MMIO region.
- MmioError::Unaligned: if the offset is not suitably aligned.
Sourcefn try_store<M: Mmio + ?Sized>(
mmio: &mut M,
offset: usize,
value: Self,
) -> Result<(), MmioError>
fn try_store<M: Mmio + ?Sized>( mmio: &mut M, offset: usize, value: Self, ) -> Result<(), MmioError>
Stores a value of this type to the MMIO region at the given offset.
§Errors
- MmioError::OutOfRange: if the store would exceed the bounds of this MMIO region.
- [MmioError::Unaligned: if the offset is not suitably aligned.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".