pub struct ContiguousBuffer { /* private fields */ }Methods from Deref<Target = ContiguousArray<u8>>§
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 Deref for ContiguousBuffer
impl Deref for ContiguousBuffer
Source§impl DerefMut for ContiguousBuffer
impl DerefMut for ContiguousBuffer
Source§impl Drop for ContiguousBuffer
impl Drop for ContiguousBuffer
impl Send for ContiguousBuffer
Auto Trait Implementations§
impl !RefUnwindSafe for ContiguousBuffer
impl !UnwindSafe for ContiguousBuffer
impl Freeze for ContiguousBuffer
impl Sync for ContiguousBuffer
impl Unpin for ContiguousBuffer
impl UnsafeUnpin for ContiguousBuffer
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