[][src]Struct v4l::buffer::StreamItem

pub struct StreamItem<'a, T> { /* fields omitted */ }

Stream item wrapper

The sole purpose of this wrapper struct is to attach a lifetime to values of type T. This is especially useful for volatile types such as views which provide access to some kind of underlying data.

Implementations

impl<'a, T> StreamItem<'a, T>[src]

pub fn new(item: T) -> Self[src]

Returns a wrapped stream item by moving it into the wrapper

An explicit lifetime is attached automatically by inserting PhantomData.

Arguments

  • item - Item to be wrapped

Example

use std::ops::Deref;
use v4l::buffer::StreamItem;

let item: u32 = 123;
let wrapper = StreamItem::new(item);
assert_eq!(*wrapper.deref(), item);

Trait Implementations

impl<'a, T> Deref for StreamItem<'a, T>[src]

type Target = T

The resulting type after dereferencing.

Auto Trait Implementations

impl<'a, T> RefUnwindSafe for StreamItem<'a, T> where
    T: RefUnwindSafe

impl<'a, T> Send for StreamItem<'a, T> where
    T: Send

impl<'a, T> Sync for StreamItem<'a, T> where
    T: Sync

impl<'a, T> Unpin for StreamItem<'a, T> where
    T: Unpin

impl<'a, T> !UnwindSafe for StreamItem<'a, T>

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.