pub struct IndicatorOutput {
pub value: f64,
pub secondary: Option<f64>,
pub signal: Option<f64>,
pub extra: HashMap<String, f64>,
pub state: Option<String>,
pub reason: Option<String>,
pub artifacts: Vec<Artifact>,
}Expand description
Output struct returned by an indicator on each processed Bar.
Fields§
§value: f64§secondary: Option<f64>§signal: Option<f64>§extra: HashMap<String, f64>§state: Option<String>Machine-readable state label (e.g. “trending”, “range”, “spring”), replacing indicator-
local string keys stuffed into extra.
reason: Option<String>Human-readable explanation for the current state/value.
artifacts: Vec<Artifact>Typed result artifacts (pivots, zones, profiles, scenario progress) emitted this bar.
Implementations§
Source§impl IndicatorOutput
impl IndicatorOutput
pub fn new(value: f64) -> Self
pub fn with_secondary(self, secondary: f64) -> Self
pub fn with_signal(self, signal: f64) -> Self
pub fn with_extra(value: f64, extra: HashMap<String, f64>) -> Self
pub fn with_state(self, state: impl Into<String>) -> Self
pub fn with_reason(self, reason: impl Into<String>) -> Self
pub fn with_artifact(self, artifact: impl Into<Artifact>) -> Self
Trait Implementations§
Source§impl Clone for IndicatorOutput
impl Clone for IndicatorOutput
Source§fn clone(&self) -> IndicatorOutput
fn clone(&self) -> IndicatorOutput
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for IndicatorOutput
impl Debug for IndicatorOutput
Source§impl<'de> Deserialize<'de> for IndicatorOutput
impl<'de> Deserialize<'de> for IndicatorOutput
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for IndicatorOutput
impl PartialEq for IndicatorOutput
Source§impl Serialize for IndicatorOutput
impl Serialize for IndicatorOutput
impl StructuralPartialEq for IndicatorOutput
Auto Trait Implementations§
impl Freeze for IndicatorOutput
impl RefUnwindSafe for IndicatorOutput
impl Send for IndicatorOutput
impl Sync for IndicatorOutput
impl Unpin for IndicatorOutput
impl UnsafeUnpin for IndicatorOutput
impl UnwindSafe for IndicatorOutput
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