Cond

condition builder

Builder for a single conditional branch. Use inside a block's .when(cond, target) chain link, Cond::equals("42"), Cond::gt("100"), etc.

Methods

equals

equals(operand: Dynamic) -> ConditionHandle

Match when the comparison value equals the operand. Wire operator: Equals.

ParameterTypeRequiredDescription
operandDynamicyesRight-hand-side value the block's comparison_value is checked against, written to the wire as given: "100" as a string, 100 or Number::exact("1.10") as a number.

gt

gt(operand: Dynamic) -> ConditionHandle

Match when the (numeric) comparison value is greater than the operand. Wire operator: NumberGreaterThan.

ParameterTypeRequiredDescription
operandDynamicyesRight-hand-side value the block's comparison_value is checked against, written to the wire as given: "100" as a string, 100 or Number::exact("1.10") as a number.

lt

lt(operand: Dynamic) -> ConditionHandle

Match when the (numeric) comparison value is less than the operand. Wire operator: NumberLessThan.

ParameterTypeRequiredDescription
operandDynamicyesRight-hand-side value the block's comparison_value is checked against, written to the wire as given: "100" as a string, 100 or Number::exact("1.10") as a number.

ge

ge(operand: Dynamic) -> ConditionHandle

Match when the (numeric) comparison value is greater than or equal to the operand. Wire operator: NumberGreaterOrEqualTo.

ParameterTypeRequiredDescription
operandDynamicyesRight-hand-side value the block's comparison_value is checked against, written to the wire as given: "100" as a string, 100 or Number::exact("1.10") as a number.

le

le(operand: Dynamic) -> ConditionHandle

Match when the (numeric) comparison value is less than or equal to the operand. Wire operator: NumberLessOrEqualTo.

ParameterTypeRequiredDescription
operandDynamicyesRight-hand-side value the block's comparison_value is checked against, written to the wire as given: "100" as a string, 100 or Number::exact("1.10") as a number.

contains

contains(operand: Dynamic) -> ConditionHandle

Match when the comparison value contains the operand. Wire operator: TextContains.

ParameterTypeRequiredDescription
operandDynamicyesRight-hand-side value the block's comparison_value is checked against, written to the wire as given: "100" as a string, 100 or Number::exact("1.10") as a number.

starts_with

starts_with(operand: Dynamic) -> ConditionHandle

Match when the comparison value starts with the operand. Wire operator: TextStartsWith.

ParameterTypeRequiredDescription
operandDynamicyesRight-hand-side value the block's comparison_value is checked against, written to the wire as given: "100" as a string, 100 or Number::exact("1.10") as a number.

ends_with

ends_with(operand: Dynamic) -> ConditionHandle

Match when the comparison value ends with the operand. Wire operator: TextEndsWith.

ParameterTypeRequiredDescription
operandDynamicyesRight-hand-side value the block's comparison_value is checked against, written to the wire as given: "100" as a string, 100 or Number::exact("1.10") as a number.

raw

raw(operator: String, operands: Array) -> ConditionHandle

Escape hatch for unmodelled condition operators.

ParameterTypeRequiredDescription
operatorStringyesWire operator name, for cases where the typed Cond::<op> surface doesn't include the operator yet.
operandsArrayyesOperand list, each written to the wire as given; most operators take one operand, some take two.