pub struct CoherentView<'a, T: ?Sized> { /* private fields */ }Expand description
View type for Coherent.
This is same as SysMem but with additional information that allows handing out a DMA handle.
Implementations§
Source§impl<'a, T: ?Sized> CoherentView<'a, T>
impl<'a, T: ?Sized> CoherentView<'a, T>
Sourcepub fn as_sys_mem(self) -> SysMem<'a, T>
pub fn as_sys_mem(self) -> SysMem<'a, T>
Erase the DMA handle information and obtain a SysMem view of the same memory region.
Sourcepub fn dma_handle(self) -> DmaAddress
pub fn dma_handle(self) -> DmaAddress
Returns a DMA handle which may be given to the device as the DMA address base of the region.
Sourcepub unsafe fn as_ref(self) -> &'a T
pub unsafe fn as_ref(self) -> &'a T
Returns a reference to the data in the region.
§Safety
- Callers must ensure that the device does not read/write to/from memory while the returned reference is live.
- Callers must ensure that this call does not race with a write (including call to
as_mut) to the same region while the returned reference is live.
Sourcepub unsafe fn as_mut(self) -> &'a mut T
pub unsafe fn as_mut(self) -> &'a mut T
Returns a mutable reference to the data in the region.
§Safety
- Callers must ensure that the device does not read/write to/from memory while the returned reference is live.
- Callers must ensure that this call does not race with a read (including call to
as_ref) or write (including call toas_mut) to the same region while the returned reference is live.
Trait Implementations§
Source§impl<T: ?Sized> Clone for CoherentView<'_, T>
impl<T: ?Sized> Clone for CoherentView<'_, T>
impl<T: ?Sized> Copy for CoherentView<'_, T>
Auto Trait Implementations§
impl<'a, T> Freeze for CoherentView<'a, T>where
T: ?Sized,
impl<'a, T> RefUnwindSafe for CoherentView<'a, T>where
T: RefUnwindSafe + ?Sized,
impl<'a, T> Send for CoherentView<'a, T>
impl<'a, T> Sync for CoherentView<'a, T>
impl<'a, T> Unpin for CoherentView<'a, T>where
T: ?Sized,
impl<'a, T> UnsafeUnpin for CoherentView<'a, T>where
T: ?Sized,
impl<'a, T> UnwindSafe for CoherentView<'a, T>where
T: RefUnwindSafe + ?Sized,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<'a, T> Io<'a> for Twhere
T: IoBase<'a>,
impl<'a, T> Io<'a> for Twhere
T: IoBase<'a>,
Source§fn try_cast<U>(self) -> Result<<Self::Backend as IoBackend>::View<'a, U>>
fn try_cast<U>(self) -> Result<<Self::Backend as IoBackend>::View<'a, U>>
Try to convert into a different typed I/O view. Read more
Source§fn copy_write(self, value: Self::Target)
fn copy_write(self, value: Self::Target)
Copy-write to I/O memory. Read more
Source§fn copy_from_slice(self, data: &[u8])
fn copy_from_slice(self, data: &[u8])
Copy bytes from
data to I/O memory. Read moreSource§fn copy_to_slice(self, data: &mut [u8])
fn copy_to_slice(self, data: &mut [u8])
Copy bytes from I/O memory to
data. Read moreSource§fn try_read8(self, offset: usize) -> Result<u8>
fn try_read8(self, offset: usize) -> Result<u8>
Fallible 8-bit read with runtime bounds check.
Source§fn try_read16(self, offset: usize) -> Result<u16>
fn try_read16(self, offset: usize) -> Result<u16>
Fallible 16-bit read with runtime bounds check.
Source§fn try_read32(self, offset: usize) -> Result<u32>
fn try_read32(self, offset: usize) -> Result<u32>
Fallible 32-bit read with runtime bounds check.
Source§fn try_read64(self, offset: usize) -> Result<u64>
fn try_read64(self, offset: usize) -> Result<u64>
Fallible 64-bit read with runtime bounds check.
Source§fn try_write8(self, value: u8, offset: usize) -> Result
fn try_write8(self, value: u8, offset: usize) -> Result
Fallible 8-bit write with runtime bounds check.
Source§fn try_write16(self, value: u16, offset: usize) -> Result
fn try_write16(self, value: u16, offset: usize) -> Result
Fallible 16-bit write with runtime bounds check.
Source§fn try_write32(self, value: u32, offset: usize) -> Result
fn try_write32(self, value: u32, offset: usize) -> Result
Fallible 32-bit write with runtime bounds check.
Source§fn try_write64(self, value: u64, offset: usize) -> Result
fn try_write64(self, value: u64, offset: usize) -> Result
Fallible 64-bit write with runtime bounds check.
Source§fn write8(self, value: u8, offset: usize)
fn write8(self, value: u8, offset: usize)
Infallible 8-bit write with compile-time bounds check.
Source§fn write16(self, value: u16, offset: usize)
fn write16(self, value: u16, offset: usize)
Infallible 16-bit write with compile-time bounds check.
Source§fn write32(self, value: u32, offset: usize)
fn write32(self, value: u32, offset: usize)
Infallible 32-bit write with compile-time bounds check.
Source§fn write64(self, value: u64, offset: usize)
fn write64(self, value: u64, offset: usize)
Infallible 64-bit write with compile-time bounds check.
Source§fn try_read<T, L>(self, location: L) -> Result<T>
fn try_read<T, L>(self, location: L) -> Result<T>
Generic fallible read with runtime bounds check. Read more
Source§fn try_write<T, L>(self, location: L, value: T) -> Result
fn try_write<T, L>(self, location: L, value: T) -> Result
Generic fallible write with runtime bounds check. Read more
Source§fn try_write_reg<T, L, V>(self, value: V) -> Result
fn try_write_reg<T, L, V>(self, value: V) -> Result
Generic fallible write of a fully-located register value. Read more
Source§fn try_update<T, L, F>(self, location: L, f: F) -> Result
fn try_update<T, L, F>(self, location: L, f: F) -> Result
Generic fallible update with runtime bounds check. Read more
Source§fn read<T, L>(self, location: L) -> T
fn read<T, L>(self, location: L) -> T
Generic infallible read with compile-time bounds check. Read more
Source§fn write<T, L>(self, location: L, value: T)
fn write<T, L>(self, location: L, value: T)
Generic infallible write with compile-time bounds check. Read more
Source§impl<T> KnownSize for T
impl<T> KnownSize for T
Source§impl<T> PinInit<T> for T
impl<T> PinInit<T> for T
Source§unsafe fn __pinned_init(self, slot: *mut T) -> Result<(), Infallible>
unsafe fn __pinned_init(self, slot: *mut T) -> Result<(), Infallible>
Initializes
slot. Read more