pub struct Observer(/* private fields */);Expand description
Cheap clonable fan-out over many observers (pipecat TaskObserver proxy,
task.py:401). When empty, the run loop never calls into it.
Implementations§
Source§impl Observer
impl Observer
Sourcepub fn new(observers: Vec<Arc<dyn FrameObserver>>) -> Self
pub fn new(observers: Vec<Arc<dyn FrameObserver>>) -> Self
Build a fan-out over observers.
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Whether any observer is registered (the run loop checks this to stay
zero-cost when off — though it also Option-gates the whole Observer).
Sourcepub async fn on_process(&self, e: &FrameEvent<'_>)
pub async fn on_process(&self, e: &FrameEvent<'_>)
Fan on_process out to every observer.
Sourcepub async fn on_push(&self, e: &FramePushEvent<'_>)
pub async fn on_push(&self, e: &FramePushEvent<'_>)
Fan on_push out to every observer.
Sourcepub async fn on_pipeline_started(&self)
pub async fn on_pipeline_started(&self)
Fan on_pipeline_started out to every observer.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Observer
impl !UnwindSafe for Observer
impl Freeze for Observer
impl Send for Observer
impl Sync for Observer
impl Unpin for Observer
impl UnsafeUnpin for Observer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more