pub struct Arena {
common: Common,
bufs: Vec<DmaBuf>,
}
Expand description
Manage dmabuf buffers
All buffers are released in the Drop impl.
Fields§
§common: Common
§bufs: Vec<DmaBuf>
Implementations§
source§impl Arena
impl Arena
sourcepub fn new(handle: Arc<Handle>, buf_type: Type) -> Self
pub fn new(handle: Arc<Handle>, buf_type: Type) -> Self
Returns a new buffer manager instance
You usually do not need to use this directly. A UserBufferStream creates its own manager instance by default.
§Arguments
handle
- Device handle to get its file descriptorbuf_type
- Type of the buffers
sourcepub fn allocate(&mut self, count: u32) -> Result<usize>
pub fn allocate(&mut self, count: u32) -> Result<usize>
Returns the number of allocated buffers
pub fn len(&self) -> usize
Auto Trait Implementations§
impl Freeze for Arena
impl RefUnwindSafe for Arena
impl Send for Arena
impl Sync for Arena
impl Unpin for Arena
impl UnwindSafe for Arena
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