Skip to main content

VmoOpHelper

Struct VmoOpHelper 

Source
pub struct VmoOpHelper<'a, T> { /* private fields */ }
Expand description

Helper providing contextual information and operations for an MMIO access.

Implementations§

Source§

impl<'a, T> VmoOpHelper<'a, T>

Source

pub fn offset(&self) -> usize

Returns the relative offset for this vmo operation.

NOTE: A VmoOpHelper can be decorated by shifting an internally-kept relative offset to help build fakes with relative register bank addresses. See VmoOpHelper::apply_offset.

Source

pub fn range(&self) -> Range<usize> ⓘ

Returns the relative memory range for this vmo operation.

See VmoOpHelper::offset.

Source

pub fn vmo_offset(&self) -> usize

Returns the offset of this operation relative to the start of the wrapped VMO.

Use VmoOpHelper::vmo_offset when using VmoOpHelper::unsafe_mmio.

Source

pub fn vmo_range(&self) -> Range<usize> ⓘ

Returns the memory for this vmo operation relative to the start of the wrapped VMO.

See VmoOpHelper::vmo_offset.

Source

pub fn unsafe_mmio(&self) -> &'a impl UnsafeMmio

Provides access to the underlying unsafe mmio implementation.

Source

pub fn apply_offset(self, offset: usize) -> Self

Applies offset to this VmoOpHelper.

This function is used so that any further receivers of this VmoOpHelper can work in an offset address space. For example, when register banks are defined with offsets or when reusing register definitions post an mmio::MmioSplit region.

§Panics

Panics if offset is larger than the current relative offset.

Source§

impl<'a, T: MmioOperand> VmoOpHelper<'a, T>

Source

pub fn load(&self) -> T

Performs the load from the underlying VMO memory.

Source

pub fn store(&self, value: T)

Performs the store to the underlying VMO memory.

Auto Trait Implementations§

§

impl<'a, T> Freeze for VmoOpHelper<'a, T>

§

impl<'a, T> RefUnwindSafe for VmoOpHelper<'a, T>
where T: RefUnwindSafe,

§

impl<'a, T> Send for VmoOpHelper<'a, T>
where T: Send,

§

impl<'a, T> Sync for VmoOpHelper<'a, T>
where T: Sync,

§

impl<'a, T> Unpin for VmoOpHelper<'a, T>
where T: Unpin,

§

impl<'a, T> UnsafeUnpin for VmoOpHelper<'a, T>

§

impl<'a, T> UnwindSafe for VmoOpHelper<'a, T>
where T: UnwindSafe,

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.