Skip to main content

CameraDevice

Trait CameraDevice 

Source
pub trait CameraDevice {
    type Stream: CameraStream;
    type Error: Error;

    // Required methods
    fn id(&self) -> &str;
    fn name(&self) -> &str;
    fn supported_formats(
        &self,
    ) -> Result<impl Iterator<Item = FormatDescriptor>, Self::Error>;
    fn open(self, config: &StreamConfig) -> Result<Self::Stream, Self::Error>;
}
Expand description

A camera device that can be inspected and opened.

Required Associated Types§

Required Methods§

Source

fn id(&self) -> &str

Source

fn name(&self) -> &str

Source

fn supported_formats( &self, ) -> Result<impl Iterator<Item = FormatDescriptor>, Self::Error>

Source

fn open(self, config: &StreamConfig) -> Result<Self::Stream, 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§