[−][src]Struct v4l::buffers::host::HostBuffer
Represents a host buffer backed by RAM
Implementations
impl HostBuffer
[src]
pub fn new(view: &[u8], meta: Metadata) -> Self
[src]
Returns a buffer backed by host memory (RAM)
The view
slice is copied by cloning its bytes into a backing storage
container. This means a HostBuffer
can always be passed around
freely with no associated lifetimes.
Arguments
view
- Slice of raw memorymeta
- Metadata, usually filled in by the driver
Example
use v4l::{buffer, HostBuffer, 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 = HostBuffer::new(&data, meta);
pub fn from<B: Buffer>(buf: &B) -> Self
[src]
Trait Implementations
impl Buffer for HostBuffer
[src]
Auto Trait Implementations
impl RefUnwindSafe for HostBuffer
impl Send for HostBuffer
impl Sync for HostBuffer
impl Unpin for HostBuffer
impl UnwindSafe for HostBuffer
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>,