Skip to main content

DetectionConsumer

Trait DetectionConsumer 

Source
pub trait DetectionConsumer: Send + Sync {
    // Required methods
    fn name(&self) -> &'static str;
    fn interested_in(&self, task_type: &str) -> bool;
    fn consume<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        batch: &'life1 DetectionBatch<'life2>,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
}
Expand description

A pluggable interpreter of detection batches. Implementors live in their own module/crate (zones is kernel-open; ANPR/entry is a proprietary app) and are registered into crate::state::AppState.

Required Methods§

Source

fn name(&self) -> &'static str

Stable name for logs/metrics.

Source

fn interested_in(&self, task_type: &str) -> bool

Whether this consumer wants batches of the given task_type. Return true for all types when the consumer is task-agnostic (e.g. the zone engine evaluates any tracked detection).

Source

fn consume<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, batch: &'life1 DetectionBatch<'life2>, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Process a persisted batch. Must not panic; errors are the consumer’s own to log/handle.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§