Skip to main content

Observable

Trait Observable 

Source
pub trait Observable: Send + Sync {
    // Required methods
    fn add_observer(&mut self, observer: Arc<dyn Observer>);
    fn notify_start(&self, node_name: &str, inputs: &Value);
    fn notify_end(&self, node_name: &str, outputs: &Value);
    fn notify_error(&self, node_name: &str, error: &str);
}
Expand description

Trait for nodes that can be observed

Required Methods§

Source

fn add_observer(&mut self, observer: Arc<dyn Observer>)

Add an observer to this observable

Source

fn notify_start(&self, node_name: &str, inputs: &Value)

Notify observers that a node has started

Source

fn notify_end(&self, node_name: &str, outputs: &Value)

Notify observers that a node has completed

Source

fn notify_error(&self, node_name: &str, error: &str)

Notify observers that a node encountered an error

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§