Skip to main content

GraphIndicator

Trait GraphIndicator 

Source
pub trait GraphIndicator: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn dependencies(&self) -> &[String];
    fn reset(&mut self);
    fn compute(
        &mut self,
        bar: &Bar,
        deps: &HashMap<String, IndicatorOutput>,
    ) -> Option<IndicatorOutput>;

    // Provided method
    fn warmup_period(&self) -> usize { ... }
}
Expand description

A node in a CompositionGraph. Unlike Indicator, compute also receives the current bar’s already-computed outputs of this node’s declared GraphIndicator::dependencies.

Required Methods§

Source

fn name(&self) -> &str

Source

fn dependencies(&self) -> &[String]

Names of other graph nodes whose current-bar output this node reads via deps in GraphIndicator::compute. Must match node names actually present in the graph.

Source

fn reset(&mut self)

Source

fn compute( &mut self, bar: &Bar, deps: &HashMap<String, IndicatorOutput>, ) -> Option<IndicatorOutput>

Provided Methods§

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§