pub struct CompositionGraph { /* private fields */ }Expand description
A dependency-ordered set of GraphIndicator nodes, executed together per bar.
Implementations§
Source§impl CompositionGraph
impl CompositionGraph
Sourcepub fn build(nodes: Vec<Box<dyn GraphIndicator>>) -> Result<Self, GraphError>
pub fn build(nodes: Vec<Box<dyn GraphIndicator>>) -> Result<Self, GraphError>
Builds a graph from nodes, computing a topological execution order and each node’s
effective warmup (its own warmup_period plus the maximum effective warmup of its
dependencies). Fails on duplicate node names, references to unknown dependencies, or a
dependency cycle.
Sourcepub fn order(&self) -> &[String]
pub fn order(&self) -> &[String]
Execution order computed at CompositionGraph::build time (dependencies before
dependents).
Sourcepub fn effective_warmup(&self, name: &str) -> Option<usize>
pub fn effective_warmup(&self, name: &str) -> Option<usize>
A node’s effective warmup: its own warmup plus the maximum effective warmup among its dependencies.
Sourcepub fn on_bar(&mut self, bar: &Bar) -> HashMap<String, Option<IndicatorOutput>>
pub fn on_bar(&mut self, bar: &Bar) -> HashMap<String, Option<IndicatorOutput>>
Runs one bar through every node in dependency order, making each node’s output available to its dependents within the same call. Returns every node’s output for this bar.
pub fn reset(&mut self)
Auto Trait Implementations§
impl !RefUnwindSafe for CompositionGraph
impl !UnwindSafe for CompositionGraph
impl Freeze for CompositionGraph
impl Send for CompositionGraph
impl Sync for CompositionGraph
impl Unpin for CompositionGraph
impl UnsafeUnpin for CompositionGraph
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