pub struct BufferMemoryMapper { /* private fields */ }Expand description
Maps a region of memory over a vector. Useful for testing.
Implementations§
Trait Implementations§
Source§impl MemoryMapper for BufferMemoryMapper
impl MemoryMapper for BufferMemoryMapper
Source§fn create(_address: usize, _size: usize) -> Result<Self, &'static str>where
Self: Sized,
fn create(_address: usize, _size: usize) -> Result<Self, &'static str>where
Self: Sized,
Create a Mapper that maps the given physical address and size.
Source§fn len(&self) -> usize
fn len(&self) -> usize
Returns the maximum length that can be addressed. The end of this
memory mapped range is
address + len().Source§fn as_mut_ptr<T>(&mut self) -> *mut T
fn as_mut_ptr<T>(&mut self) -> *mut T
Returns a mutable pointer to the mapped memory region.
Source§fn as_range(&self, range: impl RangeBounds<usize>) -> &[u8] ⓘ
fn as_range(&self, range: impl RangeBounds<usize>) -> &[u8] ⓘ
Creates an inner range of bytes. The offsets are relative to the base
of the mapped memory, e.g.
as_range(0..4) will return the first 4
bytes of the mapped memory (a memory mapping to address 0x12340000 will
map 0x12340000..0x12340004).Source§fn as_mut_range(&mut self, range: impl RangeBounds<usize>) -> &mut [u8] ⓘ
fn as_mut_range(&mut self, range: impl RangeBounds<usize>) -> &mut [u8] ⓘ
Creates an inner mutable range of bytes.
Auto Trait Implementations§
impl Freeze for BufferMemoryMapper
impl RefUnwindSafe for BufferMemoryMapper
impl Send for BufferMemoryMapper
impl Sync for BufferMemoryMapper
impl Unpin for BufferMemoryMapper
impl UnwindSafe for BufferMemoryMapper
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