pub struct Arena<'a> {
handle: Arc<Handle>,
pub bufs: Vec<&'a mut [u8]>,
pub buf_type: Type,
}
Expand description
Manage mapped buffers
All buffers are unmapped in the Drop impl. In case of errors during unmapping, we panic because there is memory corruption going on.
Fields§
§handle: Arc<Handle>
§bufs: Vec<&'a mut [u8]>
§buf_type: Type
Implementations§
source§impl<'a> Arena<'a>
impl<'a> Arena<'a>
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 MappedBufferStream creates its own manager instance by default.
§Arguments
handle
- Device handle to get its file descriptorbuf_type
- Type of the buffers
fn buffer_desc(&self) -> v4l2_buffer
fn requestbuffers_desc(&self) -> v4l2_requestbuffers
pub fn allocate(&mut self, count: u32) -> Result<u32>
pub fn release(&mut self) -> Result<()>
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Arena<'a>
impl<'a> RefUnwindSafe for Arena<'a>
impl<'a> Send for Arena<'a>
impl<'a> Sync for Arena<'a>
impl<'a> Unpin for Arena<'a>
impl<'a> !UnwindSafe for Arena<'a>
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