pub struct ContiguousArray<T: DmaPod> { /* private fields */ }Implementations§
Source§impl<T: DmaPod> ContiguousArray<T>
impl<T: DmaPod> ContiguousArray<T>
pub fn dma_addr(&self) -> DmaAddr
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn bytes_len(&self) -> usize
pub fn read_cpu(&self, index: usize) -> Option<T>
pub fn set_cpu(&mut self, index: usize, value: T)
pub fn copy_from_slice_cpu(&mut self, src: &[T])
pub fn iter_cpu(&self) -> ArrayCpuIter<'_, T, Self> ⓘ
pub fn sync_for_device(&self, offset: usize, size: usize)
pub fn sync_for_cpu(&self, offset: usize, size: usize)
pub fn sync_for_device_all(&self)
pub fn sync_for_cpu_all(&self)
pub fn prepare_for_device(&self, offset: usize, size: usize)
pub fn prepare_for_device_all(&self)
pub fn complete_for_cpu(&self, offset: usize, size: usize)
pub fn complete_for_cpu_all(&self)
pub fn write_for_device<R>( &mut self, len: usize, f: impl FnOnce(&mut [T]) -> R, ) -> R
pub fn read_from_device<R>(&self, len: usize, f: impl FnOnce(&[T]) -> R) -> R
pub fn copy_to_device_from_slice(&mut self, src: &[T])
pub fn copy_from_device_to_slice(&self, dst: &mut [T])
pub fn write_with_cpu<R>( &mut self, len: usize, f: impl FnOnce(&mut [T]) -> R, ) -> R
pub fn read_with_cpu<R>(&self, len: usize, f: impl FnOnce(&[T]) -> R) -> R
pub fn as_ptr(&self) -> NonNull<T>
pub fn as_slice_cpu(&self) -> &[T]
Sourcepub unsafe fn as_mut_slice_cpu(&mut self) -> &mut [T]
pub unsafe fn as_mut_slice_cpu(&mut self) -> &mut [T]
§Safety
The caller must ensure the device is not concurrently accessing this memory in a way that races with CPU writes.
Trait Implementations§
Source§impl<T: DmaPod> DmaArrayCpuRead<T> for ContiguousArray<T>
impl<T: DmaPod> DmaArrayCpuRead<T> for ContiguousArray<T>
impl<T: DmaPod + Send> Send for ContiguousArray<T>
impl<T: DmaPod + Sync> Sync for ContiguousArray<T>
Auto Trait Implementations§
impl<T> !RefUnwindSafe for ContiguousArray<T>
impl<T> !UnwindSafe for ContiguousArray<T>
impl<T> Freeze for ContiguousArray<T>
impl<T> Unpin for ContiguousArray<T>where
T: Unpin,
impl<T> UnsafeUnpin for ContiguousArray<T>
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