pub struct VmoMemory<H> { /* private fields */ }Expand description
A wrapper around an UnsafeMmio underlying storage that permits injecting
behavior on reads and writes to the underlying VMO.
The H handler type is an implementation of VmoMemoryHandler, which is
tailored specifically for intersecting loads and stores to the underlying
VMO.
Note that VmoMemory always operates on CachedVmoMemory, since the
fakes are running in the same process as the test, and there’s no
device/peripheral memory in play.
Implementations§
Source§impl<H: VmoMemoryWrapper> VmoMemory<H>
impl<H: VmoMemoryWrapper> VmoMemory<H>
Trait Implementations§
Source§impl<H: VmoMemoryHandler> UnsafeMmio for VmoMemory<H>
impl<H: VmoMemoryHandler> UnsafeMmio for VmoMemory<H>
Source§fn len(&self) -> usize
fn len(&self) -> usize
Returns the size, in bytes, of the underlying MMIO region that can be accessed through this
object.
Source§fn align_offset(&self, align: usize) -> usize
fn align_offset(&self, align: usize) -> usize
Returns the first offset into this MMIO region that is suitably aligned for
align. Read moreSource§unsafe fn load8_unchecked(&self, offset: usize) -> u8
unsafe fn load8_unchecked(&self, offset: usize) -> u8
Loads a u8 from this MMIO region at the given offset. Read more
Source§unsafe fn load16_unchecked(&self, offset: usize) -> u16
unsafe fn load16_unchecked(&self, offset: usize) -> u16
Loads a u16 from this MMIO region at the given offset. Read more
Source§unsafe fn load32_unchecked(&self, offset: usize) -> u32
unsafe fn load32_unchecked(&self, offset: usize) -> u32
Loads a u32 from this MMIO region at the given offset. Read more
Source§unsafe fn load64_unchecked(&self, offset: usize) -> u64
unsafe fn load64_unchecked(&self, offset: usize) -> u64
Loads a u64 from this MMIO region at the given offset. Read more
Source§unsafe fn store8_unchecked(&self, offset: usize, v: u8)
unsafe fn store8_unchecked(&self, offset: usize, v: u8)
Stores a u8 to this MMIO region at the given offset. Read more
Source§unsafe fn store16_unchecked(&self, offset: usize, v: u16)
unsafe fn store16_unchecked(&self, offset: usize, v: u16)
Stores a u16 to this MMIO region at the given offset. Read more
Source§unsafe fn store32_unchecked(&self, offset: usize, v: u32)
unsafe fn store32_unchecked(&self, offset: usize, v: u32)
Stores a u32 to this MMIO region at the given offset. Read more
Source§unsafe fn store64_unchecked(&self, offset: usize, v: u64)
unsafe fn store64_unchecked(&self, offset: usize, v: u64)
Stores a u64 to this MMIO region at the given offset. Read more
Source§fn write_barrier(&self)
fn write_barrier(&self)
Issues a memory write barrier. It is guaranteed that all stores preceding this barrier will
appear to have happened before all stores following this barrier.
Source§fn read_barrier(&self)
fn read_barrier(&self)
Issues a memory read barrier. It is guaranteed that all loads preceding this barrier will
appear to have happened before all loads following this barrier. Read more
Auto Trait Implementations§
impl<H> Freeze for VmoMemory<H>where
H: Freeze,
impl<H> RefUnwindSafe for VmoMemory<H>where
H: RefUnwindSafe,
impl<H> Send for VmoMemory<H>where
H: Send,
impl<H> Sync for VmoMemory<H>where
H: Sync,
impl<H> Unpin for VmoMemory<H>where
H: Unpin,
impl<H> UnsafeUnpin for VmoMemory<H>where
H: UnsafeUnpin,
impl<H> UnwindSafe for VmoMemory<H>where
H: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more