pub struct SharedMmioPointer<'a, T: ?Sized> { /* private fields */ }Expand description
A shared pointer to the registers of some MMIO device.
It is guaranteed to be valid but unlike UniqueMmioPointer may not be unique.
Implementations§
Sourcepub unsafe fn read_unsafe(&self) -> T
pub unsafe fn read_unsafe(&self) -> T
Performs an MMIO read of the entire T.
§Safety
This field must be safe to perform an MMIO read from, and doing so must not cause any side-effects.
Sourcepub const unsafe fn child<U: ?Sized>(
&self,
regs: NonNull<U>,
) -> SharedMmioPointer<'a, U>
pub const unsafe fn child<U: ?Sized>( &self, regs: NonNull<U>, ) -> SharedMmioPointer<'a, U>
Creates a new SharedMmioPointer with the same lifetime as this one.
This is used internally by the field_shared! macro and shouldn’t be called directly.
§Safety
regs must be a properly aligned and valid pointer to some MMIO address space of type T,
within the allocation that self points to.
Sourcepub const fn get(&self, index: usize) -> Option<SharedMmioPointer<'a, T>>
pub const fn get(&self, index: usize) -> Option<SharedMmioPointer<'a, T>>
Returns a SharedMmioPointer to an element of this slice, or None if the index is out of
bounds.
Sourcepub fn split(&self) -> [SharedMmioPointer<'a, T>; LEN]
pub fn split(&self) -> [SharedMmioPointer<'a, T>; LEN]
Splits a SharedMmioPointer to an array into an array of SharedMmioPointers.
Sourcepub const fn as_slice(&self) -> SharedMmioPointer<'a, [T]>
pub const fn as_slice(&self) -> SharedMmioPointer<'a, [T]>
Converts this array pointer to an equivalent slice pointer.
Sourcepub const fn get(&self, index: usize) -> Option<SharedMmioPointer<'a, T>>
pub const fn get(&self, index: usize) -> Option<SharedMmioPointer<'a, T>>
Returns a SharedMmioPointer to an element of this array, or None if the index is out of
bounds.
Trait Implementations§
Source§fn from(value: SharedMmioPointer<'a, [T; LEN]>) -> Self
fn from(value: SharedMmioPointer<'a, [T; LEN]>) -> Self
Source§fn from(value: SharedMmioPointer<'a, T>) -> Self
fn from(value: SharedMmioPointer<'a, T>) -> Self
Source§fn from(value: SharedMmioPointer<'a, T>) -> Self
fn from(value: SharedMmioPointer<'a, T>) -> Self
Source§fn from(unique: UniqueMmioPointer<'a, T>) -> Self
fn from(unique: UniqueMmioPointer<'a, T>) -> Self
Auto Trait Implementations§
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)