pub struct DmaPool { /* private fields */ }
Expand description
A pool for allocating DMA regions that all share a common access type and DMA options.
Implementations§
Source§impl DmaPool
impl DmaPool
Sourcepub fn new(spec: ObjectBuilder<()>, access: Access, opts: DmaOptions) -> Self
pub fn new(spec: ObjectBuilder<()>, access: Access, opts: DmaOptions) -> Self
Create a new DmaPool with access and DMA options, where each created underlying Twizzler object is created using the provided ObjectBuilder. If default (volatile) options are acceptable for the create spec, use the crate::dma::DmaPool::default_spec function.
pub fn default_spec() -> ObjectBuilder<()>
Sourcepub fn allocate<'a, T: DeviceSync>(
&'a self,
init: T,
) -> Result<DmaRegion<T>, AllocationError>
pub fn allocate<'a, T: DeviceSync>( &'a self, init: T, ) -> Result<DmaRegion<T>, AllocationError>
Allocate a new [DmaRegion]
from the pool. The region will be initialized with the
provided initial value.
Sourcepub fn allocate_array<'a, T: DeviceSync + Clone>(
&'a self,
count: usize,
init: T,
) -> Result<DmaSliceRegion<T>, AllocationError>
pub fn allocate_array<'a, T: DeviceSync + Clone>( &'a self, count: usize, init: T, ) -> Result<DmaSliceRegion<T>, AllocationError>
Allocate a new [DmaSliceRegion]
from the pool. Each entry in the region’s slice will
be initialized with the provided initial value.
Sourcepub fn allocate_array_with<'a, T: DeviceSync>(
&'a self,
count: usize,
init: impl Fn() -> T,
) -> Result<DmaSliceRegion<T>, AllocationError>
pub fn allocate_array_with<'a, T: DeviceSync>( &'a self, count: usize, init: impl Fn() -> T, ) -> Result<DmaSliceRegion<T>, AllocationError>
Allocate a new [DmaSliceRegion]
from the pool. Each entry in the region’s slice will
be initialized by running the provided closure.
Auto Trait Implementations§
impl !DeviceSync for DmaPool
impl !Freeze for DmaPool
impl !ObjSafe for DmaPool
impl RefUnwindSafe for DmaPool
impl Send for DmaPool
impl StoreCopy for DmaPool
impl Sync for DmaPool
impl Unpin for DmaPool
impl UnwindSafe for DmaPool
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