Skip to main content

CameraSource

Trait CameraSource 

Source
pub trait CameraSource: Send + Sync {
    // Required methods
    fn configured(&self) -> bool;
    fn snapshot(&self) -> Result<Vec<u8>, String>;
}
Expand description

Source of built-in-camera frames.

Required Methods§

Source

fn configured(&self) -> bool

Whether a built-in camera could be reached at all (live mode with a target). The A1 camera is intermittently off, so true does not guarantee snapshot will return a frame.

Source

fn snapshot(&self) -> Result<Vec<u8>, String>

Grab a single JPEG frame, or an error message. Messages never include the access code (the underlying crate::camera::CameraError is careful too).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§