DevMemMemoryMapper

Struct DevMemMemoryMapper 

Source
pub struct DevMemMemoryMapper { /* private fields */ }
Expand description

A memory mapper that maps over the /dev/mem physical memory device. Only available on Linux with std feature enabled.

Trait Implementations§

Source§

impl Debug for DevMemMemoryMapper

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Drop for DevMemMemoryMapper

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl<R: RangeBounds<usize>> Index<R> for DevMemMemoryMapper

Source§

type Output = [u8]

The returned type after indexing.
Source§

fn index(&self, index: R) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl MemoryMapper for DevMemMemoryMapper

Source§

fn create(address: usize, size: usize) -> Result<Self, &'static str>

Create a Mapper that maps the given physical address and size.
Source§

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_ptr<T>(&self) -> *const T

Returns a pointer to the mapped memory region.
Source§

fn as_mut_ptr<T>(&mut self) -> *mut T

Returns a mutable pointer to the mapped memory region.
Source§

fn is_empty(&self) -> bool

Returns true if the mapping is empty.
Source§

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]

Creates an inner mutable range of bytes.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.