Struct driverkit::iomem::DmaAllocator
source · [−]pub struct DmaAllocator;
Expand description
An allocator that (supposedly) backs memory accessible by devices.
Trait Implementations
sourceimpl Allocator for DmaAllocator
impl Allocator for DmaAllocator
sourcefn allocate(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError>
🔬 This is a nightly-only experimental API. (allocator_api
)
fn allocate(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError>
allocator_api
)Allocates IO memory.
sourceunsafe fn deallocate(&self, ptr: NonNull<u8>, layout: Layout)
🔬 This is a nightly-only experimental API. (allocator_api
)
unsafe fn deallocate(&self, ptr: NonNull<u8>, layout: Layout)
allocator_api
)Deallocates the previously allocated IO memory.
sourcefn allocate_zeroed(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError>
fn allocate_zeroed(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError>
🔬 This is a nightly-only experimental API. (
allocator_api
)Behaves like allocate
, but also ensures that the returned memory is zero-initialized. Read more
sourceunsafe fn grow(
&self,
ptr: NonNull<u8>,
old_layout: Layout,
new_layout: Layout
) -> Result<NonNull<[u8]>, AllocError>
unsafe fn grow(
&self,
ptr: NonNull<u8>,
old_layout: Layout,
new_layout: Layout
) -> Result<NonNull<[u8]>, AllocError>
🔬 This is a nightly-only experimental API. (
allocator_api
)Attempts to extend the memory block. Read more
sourceunsafe fn grow_zeroed(
&self,
ptr: NonNull<u8>,
old_layout: Layout,
new_layout: Layout
) -> Result<NonNull<[u8]>, AllocError>
unsafe fn grow_zeroed(
&self,
ptr: NonNull<u8>,
old_layout: Layout,
new_layout: Layout
) -> Result<NonNull<[u8]>, AllocError>
🔬 This is a nightly-only experimental API. (
allocator_api
)Behaves like grow
, but also ensures that the new contents are set to zero before being
returned. Read more
sourceimpl Clone for DmaAllocator
impl Clone for DmaAllocator
sourcefn clone(&self) -> DmaAllocator
fn clone(&self) -> DmaAllocator
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for DmaAllocator
impl Debug for DmaAllocator
sourceimpl Default for DmaAllocator
impl Default for DmaAllocator
sourcefn default() -> DmaAllocator
fn default() -> DmaAllocator
Returns the “default value” for a type. Read more
impl Copy for DmaAllocator
Auto Trait Implementations
impl RefUnwindSafe for DmaAllocator
impl Send for DmaAllocator
impl Sync for DmaAllocator
impl Unpin for DmaAllocator
impl UnwindSafe for DmaAllocator
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more