[][src]Struct v4l::buffers::host::HostBuffer

pub struct HostBuffer { /* fields omitted */ }

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 memory
  • meta - 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

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.