Skip to main content

MmioBank

Struct MmioBank 

Source
pub struct MmioBank<Base, MaxAccess: Accessible> { /* private fields */ }
Expand description

Represents a contiguous region of memory containing registers. Contained registers are accessed via MmioBank::at and must feature access permissions narrower than MaxAccess.

Implementations§

Source§

impl<Base, MaxAccess> MmioBank<Base, MaxAccess>
where Base: Copy, MaxAccess: Accessible,

Source

pub const fn new(base: MmioPtr<Base, MaxAccess>, size_bytes: usize) -> Self

Constructs a new bank from its base pointer and length.

Source

pub const unsafe fn at<Layout, Access>( &self, offset: Offset<Layout, Access>, ) -> Mmio<Layout, Base, Access>
where Layout: LayoutOver<Base>, Access: Accessible, MaxAccess: AccessRestrictsTo<Access>,

Returns the memory-backed register at the specified offset into the bank.

§Panics

Panics if the offset is misaligned for Base or exceeds the bounds of the bank.

§Safety

Same as MmioPtr::new for underlying offset pointer.

Auto Trait Implementations§

§

impl<Base, MaxAccess> Freeze for MmioBank<Base, MaxAccess>

§

impl<Base, MaxAccess> RefUnwindSafe for MmioBank<Base, MaxAccess>
where Base: RefUnwindSafe, MaxAccess: RefUnwindSafe,

§

impl<Base, MaxAccess> Send for MmioBank<Base, MaxAccess>

§

impl<Base, MaxAccess> Sync for MmioBank<Base, MaxAccess>

§

impl<Base, MaxAccess> Unpin for MmioBank<Base, MaxAccess>
where MaxAccess: Unpin,

§

impl<Base, MaxAccess> UnsafeUnpin for MmioBank<Base, MaxAccess>

§

impl<Base, MaxAccess> UnwindSafe for MmioBank<Base, MaxAccess>
where Base: RefUnwindSafe, MaxAccess: UnwindSafe,

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

fn into(self) -> U

Calls U::from(self).

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

§

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

§

type Error = !

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

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

Performs the conversion.
§

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

§

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

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

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

Performs the conversion.