pub enum ArgValue {
Value(Value),
PrevRef {
path: String,
},
Array(Vec<ArgValue>),
Object(Vec<(String, ArgValue)>),
}Expand description
An argument value in a ParsedOp: concrete JSON, a $prev path ref, or a nested container.
Variants§
Value(Value)
A concrete JSON value (no $prev references anywhere inside).
PrevRef
A $prev or $prev.field.path back-reference (chain mode only); empty path = whole result.
Array(Vec<ArgValue>)
Array literal with at least one $prev element; pure-JSON arrays fold to Value(Array).
Object(Vec<(String, ArgValue)>)
Object literal with at least one $prev value; pure-JSON objects fold to Value(Object).
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, returning None on miss.
Sourcepub fn resolve_all<'a>(&'a self, prev_result: &'a Value) -> Option<Value>
pub fn resolve_all<'a>(&'a self, prev_result: &'a Value) -> Option<Value>
Recursively resolve all $prev refs within this value; returns None if any path is absent.
Trait Implementations§
impl StructuralPartialEq for ArgValue
Auto Trait Implementations§
impl Freeze for ArgValue
impl RefUnwindSafe for ArgValue
impl Send for ArgValue
impl Sync for ArgValue
impl Unpin for ArgValue
impl UnsafeUnpin for ArgValue
impl UnwindSafe for ArgValue
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