pub struct DmaAllocHandle { /* private fields */ }Implementations§
Source§impl DmaAllocHandle
impl DmaAllocHandle
Sourcepub unsafe fn new(
cpu_addr: NonNull<u8>,
allocation_addr: NonNull<u8>,
dma_addr: DmaAddr,
layout: Layout,
) -> Self
pub unsafe fn new( cpu_addr: NonNull<u8>, allocation_addr: NonNull<u8>, dma_addr: DmaAddr, layout: Layout, ) -> Self
Creates a handle from its CPU-visible and allocator-owned addresses.
§Safety
cpu_addr and allocation_addr must refer to the same live physical
allocation described by layout. cpu_addr must remain the only CPU
mapping exposed to the allocation owner until deallocation, and
dma_addr must be the device-visible address for those pages.
pub fn size(&self) -> usize
pub fn align(&self) -> usize
pub fn as_ptr(&self) -> NonNull<u8>
Sourcepub fn allocation_ptr(&self) -> NonNull<u8>
pub fn allocation_ptr(&self) -> NonNull<u8>
Returns the allocator-owned address required by the DMA backend when releasing this handle.
pub fn dma_addr(&self) -> DmaAddr
pub fn layout(&self) -> Layout
Trait Implementations§
Source§impl Clone for DmaAllocHandle
impl Clone for DmaAllocHandle
Source§fn clone(&self) -> DmaAllocHandle
fn clone(&self) -> DmaAllocHandle
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for DmaAllocHandle
Source§impl Debug for DmaAllocHandle
impl Debug for DmaAllocHandle
impl Eq for DmaAllocHandle
Source§impl Hash for DmaAllocHandle
impl Hash for DmaAllocHandle
Source§impl PartialEq for DmaAllocHandle
impl PartialEq for DmaAllocHandle
impl StructuralPartialEq for DmaAllocHandle
Auto Trait Implementations§
impl !Send for DmaAllocHandle
impl !Sync for DmaAllocHandle
impl Freeze for DmaAllocHandle
impl RefUnwindSafe for DmaAllocHandle
impl Unpin for DmaAllocHandle
impl UnsafeUnpin for DmaAllocHandle
impl UnwindSafe for DmaAllocHandle
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