pub trait Camera: Send + Sync {
// Required methods
fn start(&self) -> Result<String, CameraError>;
fn latest_frame(&self) -> Option<CameraFrame>;
fn stop(&self);
}Expand description
A running (or startable) live camera. Implementations are Send + Sync so a
background preview pump can start/stop and poll frames off the UI thread.
Required Methods§
Sourcefn start(&self) -> Result<String, CameraError>
fn start(&self) -> Result<String, CameraError>
Start the capture session, returning a human-readable device name. Safe to call again while already running (idempotent).
Sourcefn latest_frame(&self) -> Option<CameraFrame>
fn latest_frame(&self) -> Option<CameraFrame>
The most recent frame, or None if none has arrived yet.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".