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§
fn name(&self) -> &str
Sourcefn dependencies(&self) -> &[String]
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.
fn reset(&mut self)
fn compute( &mut self, bar: &Bar, deps: &HashMap<String, IndicatorOutput>, ) -> Option<IndicatorOutput>
Provided Methods§
fn warmup_period(&self) -> usize
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".