Skip to main content

Detector

Trait Detector 

Source
pub trait Detector: Send + 'static {
    // Required method
    fn evaluate(
        &mut self,
        view: &FrameView<'_>,
    ) -> Result<DetectorOutput, DetectorError>;

    // Provided method
    fn is_heavy(&self) -> bool { ... }
}
Expand description

Evaluates one region of one frame. Built-in detectors, gates, and user-defined detectors all implement this same trait.

Required Methods§

Source

fn evaluate( &mut self, view: &FrameView<'_>, ) -> Result<DetectorOutput, DetectorError>

Provided Methods§

Source

fn is_heavy(&self) -> bool

Heavy detectors (OCR, ML inference) are routed to the blocking thread pool by the watcher loop so they never stall the async scheduler. Cheap pixel-math detectors keep the default false.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§