Skip to main content

CameraStream

Trait CameraStream 

Source
pub trait CameraStream {
    type Frame<'a>: Frame
       where Self: 'a;
    type Error: Error;

    // Required methods
    fn start<F>(&mut self, callback: F) -> Result<(), Self::Error>
       where F: FnMut(&Self::Frame<'_>) + Send + 'static;
    fn stop(&mut self) -> Result<(), Self::Error>;
}
Expand description

Callback-based frame delivery.

Required Associated Types§

Source

type Frame<'a>: Frame where Self: 'a

Source

type Error: Error

Required Methods§

Source

fn start<F>(&mut self, callback: F) -> Result<(), Self::Error>
where F: FnMut(&Self::Frame<'_>) + Send + 'static,

Start streaming. Callback is invoked on a platform thread for each frame.

Source

fn stop(&mut self) -> Result<(), Self::Error>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§