[−][src]Struct v4l::buffer::Buffer
Represents a buffer view
Implementations
impl<'a> Buffer<'a>
[src]
pub fn new(view: &'a [u8], meta: Metadata) -> Self
[src]
Returns a memory region view
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, timestamp}; let data: Vec<u8> = Vec::new(); let ts = timestamp::Timestamp::new(0 /* sec */, 0 /* usec */); let flags = buffer::Flags::from(0); let meta = buffer::Metadata::new(0, ts, flags); let buf = buffer::Buffer::new(&data, meta);
pub fn data(&self) -> &[u8]
[src]
Slice of read-only data
pub fn meta(&self) -> &Metadata
[src]
Metadata such as allocation flags, timestamp and more
Trait Implementations
Auto Trait Implementations
impl<'a> RefUnwindSafe for Buffer<'a>
impl<'a> Send for Buffer<'a>
impl<'a> Sync for Buffer<'a>
impl<'a> Unpin for Buffer<'a>
impl<'a> UnwindSafe for Buffer<'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>,