[−][src]Struct v4l::buffer::StreamItem
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]
Auto Trait Implementations
impl<'a, T> RefUnwindSafe for StreamItem<'a, T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<'a, T> Send for StreamItem<'a, T> where
T: Send,
T: Send,
impl<'a, T> Sync for StreamItem<'a, T> where
T: Sync,
T: Sync,
impl<'a, T> Unpin for StreamItem<'a, T> where
T: Unpin,
T: Unpin,
impl<'a, T> !UnwindSafe for StreamItem<'a, T>
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>,