pub enum ArgValue {
Value(Value),
PrevRef {
path: String,
},
}Expand description
An argument value in a ParsedOp.
Most arguments are concrete JSON values. In chain ops (ADR-016 §Chain
semantics), arguments may reference the preceding op’s result via $prev
or $prev.dotted.path. Substitution happens at dispatch time, not at parse
time, because the prior result isn’t known until runtime.
Variants§
Value(Value)
A concrete JSON value.
PrevRef
A $prev or $prev.field.path reference — chain mode only.
path is the dot-separated field path after $prev. Empty string means
the whole prior result ($prev with no field selector).
Implementations§
Source§impl ArgValue
impl ArgValue
Sourcepub fn as_value(&self) -> Option<&Value>
pub fn as_value(&self) -> Option<&Value>
Returns the contained Value if this is ArgValue::Value.
Sourcepub fn is_prev_ref(&self) -> bool
pub fn is_prev_ref(&self) -> bool
Returns true if this is a $prev reference.
Sourcepub fn resolve_prev<'a>(&self, prev_result: &'a Value) -> Option<&'a Value>
pub fn resolve_prev<'a>(&self, prev_result: &'a Value) -> Option<&'a Value>
Resolve a $prev reference against a preceding op’s result.
Returns the extracted field value, or None if the path doesn’t
exist in prev_result. Non-PrevRef variants return None.