pub struct DBuff { /* private fields */ }Methods from Deref<Target = DArray<u8>>§
Sourcepub fn iter(&self) -> DArrayIter<'_, T> ⓘ
pub fn iter(&self) -> DArrayIter<'_, T> ⓘ
Sourcepub fn copy_from_slice(&mut self, src: &[T])
pub fn copy_from_slice(&mut self, src: &[T])
Sourcepub fn prepare_read(&self, offset: usize, size: usize)
pub fn prepare_read(&self, offset: usize, size: usize)
在 CPU 读取前同步指定字节范围。
对 FromDevice 和 Bidirectional 方向,这会使对应缓存范围失效。
Sourcepub fn confirm_write(&self, offset: usize, size: usize)
pub fn confirm_write(&self, offset: usize, size: usize)
在设备读取前同步指定字节范围。
对 ToDevice 和 Bidirectional 方向,这会将对应缓存范围刷回内存。
Sourcepub fn prepare_read_all(&self)
pub fn prepare_read_all(&self)
在 CPU 读取前同步整个数组。
Sourcepub fn confirm_write_all(&self)
pub fn confirm_write_all(&self)
在设备读取前同步整个数组。
Sourcepub fn write_with<R>(&mut self, len: usize, f: impl FnOnce(&mut [T]) -> R) -> R
pub fn write_with<R>(&mut self, len: usize, f: impl FnOnce(&mut [T]) -> R) -> R
直接借出一段可写切片,并在闭包返回后自动同步缓存。
Sourcepub fn read_with<R>(&self, len: usize, f: impl FnOnce(&[T]) -> R) -> R
pub fn read_with<R>(&self, len: usize, f: impl FnOnce(&[T]) -> R) -> R
直接借出一段只读切片,并在闭包调用前自动同步缓存。
Sourcepub unsafe fn as_mut_slice(&mut self) -> &mut [T]
pub unsafe fn as_mut_slice(&mut self) -> &mut [T]
§Safety
slice will not auto do cache sync operations.
pub fn as_ptr(&self) -> NonNull<T>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DBuff
impl !RefUnwindSafe for DBuff
impl !Sync for DBuff
impl Unpin for DBuff
impl UnsafeUnpin for DBuff
impl !UnwindSafe for DBuff
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