pub struct CpuDmaBuffer { /* private fields */ }Expand description
CPU-owned contiguous DMA buffer that can be prepared for one async request.
Implementations§
Source§impl CpuDmaBuffer
impl CpuDmaBuffer
pub fn new_zero( device: &DeviceDma, len: NonZeroUsize, align: usize, direction: DmaDirection, ) -> Result<Self, DmaError>
pub fn from_contiguous(backing: ContiguousArray<u8>) -> Self
pub fn len(&self) -> NonZeroUsize
pub fn is_empty(&self) -> bool
pub const fn direction(&self) -> DmaDirection
pub const fn domain_id(&self) -> DmaDomainId
pub fn cpu_ptr(&self) -> NonNull<u8>
pub fn dma_addr(&self) -> DmaAddr
pub fn segment(&self) -> DmaSegment
pub fn as_slice_cpu(&self) -> &[u8] ⓘ
Sourcepub unsafe fn as_mut_slice_cpu(&mut self) -> &mut [u8] ⓘ
pub unsafe fn as_mut_slice_cpu(&mut self) -> &mut [u8] ⓘ
§Safety
The caller must ensure no device can access this buffer while the returned mutable CPU slice is used.
pub fn copy_to_device_from_slice(&mut self, src: &[u8])
pub fn copy_from_device_to_slice(&self, dst: &mut [u8])
pub fn prepare_for_device_all(&self)
pub fn complete_for_cpu_all(&self)
pub fn prepare_for_device(self) -> PreparedDma
Auto Trait Implementations§
impl !RefUnwindSafe for CpuDmaBuffer
impl !UnwindSafe for CpuDmaBuffer
impl Freeze for CpuDmaBuffer
impl Send for CpuDmaBuffer
impl Sync for CpuDmaBuffer
impl Unpin for CpuDmaBuffer
impl UnsafeUnpin for CpuDmaBuffer
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