pub struct Condition {
pub from: String,
pub path: String,
pub op: CondOp,
pub value: Value,
}Expand description
Fields§
§from: StringID of the upstream node whose output to inspect.
path: StringDot-separated path into the upstream output (e.g. "status", "data.count").
Use "" to compare the root value.
op: CondOpComparison operator.
value: ValueRight-hand side value.
Implementations§
Source§impl Condition
impl Condition
Sourcepub fn evaluate(
&self,
outputs: &HashMap<String, Value>,
skipped: &HashSet<String>,
) -> bool
pub fn evaluate( &self, outputs: &HashMap<String, Value>, skipped: &HashSet<String>, ) -> bool
Evaluate against the full output map, respecting the skipped set.
Returns false when the source node was skipped, is missing, the path
does not resolve, or the comparison fails.
Sourcepub fn evaluate_on_value(&self, from_output: &Value) -> bool
pub fn evaluate_on_value(&self, from_output: &Value) -> bool
Evaluate directly against a single upstream output value.
Used by the "if-else" node, which already has the value in ctx.inputs.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Condition
impl<'de> Deserialize<'de> for Condition
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
Auto Trait Implementations§
impl Freeze for Condition
impl RefUnwindSafe for Condition
impl Send for Condition
impl Sync for Condition
impl Unpin for Condition
impl UnsafeUnpin for Condition
impl UnwindSafe for Condition
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