pub struct ComposedNode { /* private fields */ }Expand description
A GraphIndicator built from closures, for nodes that genuinely consume other nodes’
outputs (e.g. a Chandelier Exit reading an upstream ATR node).
Implementations§
Source§impl ComposedNode
impl ComposedNode
pub fn new( name: impl Into<String>, dependencies: Vec<String>, warmup_period: usize, compute_fn: impl FnMut(&Bar, &HashMap<String, IndicatorOutput>) -> Option<IndicatorOutput> + Send + Sync + 'static, ) -> Self
Sourcepub fn with_reset(self, reset_fn: impl FnMut() + Send + Sync + 'static) -> Self
pub fn with_reset(self, reset_fn: impl FnMut() + Send + Sync + 'static) -> Self
Registers a callback invoked on CompositionGraph::reset, for composed nodes that
capture their own mutable state in the compute_fn closure.
Trait Implementations§
Source§impl GraphIndicator for ComposedNode
impl GraphIndicator for ComposedNode
fn name(&self) -> &str
Source§fn 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 warmup_period(&self) -> usize
fn reset(&mut self)
fn compute( &mut self, bar: &Bar, deps: &HashMap<String, IndicatorOutput>, ) -> Option<IndicatorOutput>
Auto Trait Implementations§
impl !RefUnwindSafe for ComposedNode
impl !UnwindSafe for ComposedNode
impl Freeze for ComposedNode
impl Send for ComposedNode
impl Sync for ComposedNode
impl Unpin for ComposedNode
impl UnsafeUnpin for ComposedNode
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