Skip to main content

FrameObserver

Trait FrameObserver 

Source
pub trait FrameObserver: Send + Sync {
    // Provided methods
    fn on_process<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        _e: &'life1 FrameEvent<'life2>,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait { ... }
    fn on_push<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        _e: &'life1 FramePushEvent<'life2>,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait { ... }
    fn on_pipeline_started<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
}
Expand description

Non-intrusive observer. Mirrors pipecat BaseObserver (base_observer.py).

Provided Methods§

Source

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

A processor is about to handle a frame (base_observer.py:79).

Source

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

A frame was pushed source→destination (base_observer.py:91).

Source

fn on_pipeline_started<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

The pipeline finished starting (base_observer.py:103).

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§