[−][src]Struct v4l::buffers::mmap::MappedBuffer
Memory mapped buffer
The buffer is backed by camera device or kernel memory. Read only access (e.g. by directly uploading it to the GPU) is permitted for the lifetime of the buffer instance. Acquiring ownership of the data in userspace is not possible, so it has to be copied.
Implementations
impl<'a> MappedBuffer<'a>
[src]
pub fn new(view: &'a [u8], meta: Metadata) -> Self
[src]
Returns a mapped memory region representation
Buffers created this way provide read-only access to the backing data, enforcing callers to copy the data before mutating it.
Arguments
view
- Slice of raw memorymeta
- Metadata, usually filled in by the driver
Example
use v4l::{buffer, MappedBuffer, Timestamp}; let data: Vec<u8> = Vec::new(); let ts = Timestamp::new(0 /* sec */, 0 /* usec */); let flags = buffer::Flags::from(0); let meta = buffer::Metadata::new(0, ts, flags); let buf = MappedBuffer::new(&data, meta);
Trait Implementations
impl<'a> Buffer for MappedBuffer<'a>
[src]
Auto Trait Implementations
impl<'a> RefUnwindSafe for MappedBuffer<'a>
impl<'a> Send for MappedBuffer<'a>
impl<'a> Sync for MappedBuffer<'a>
impl<'a> Unpin for MappedBuffer<'a>
impl<'a> UnwindSafe for MappedBuffer<'a>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,