pub struct SequenceContext { /* private fields */ }Expand description
Shared per-sequence context. Holds the {input, response} envelope
of every bound step indexed by bind name, and resolves
{{steps.<bind>.<jsonpath>}} placeholders inside an arbitrary JSON
value tree.
Implementations§
Source§impl SequenceContext
impl SequenceContext
pub fn new() -> Self
pub fn bind(&mut self, name: String, envelope: Value)
Sourcepub fn substitute(&self, value: &Value) -> Result<Value, String>
pub fn substitute(&self, value: &Value) -> Result<Value, String>
Walks the JSON tree of value and replaces every
{{steps.<bind>.<jsonpath>}} placeholder in any string with
the resolved value. Strings that consist of exactly one
placeholder become the resolved value (preserving its JSON
type, e.g. number/object). Strings with surrounding text get
the resolved value stringified into the gap.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SequenceContext
impl RefUnwindSafe for SequenceContext
impl Send for SequenceContext
impl Sync for SequenceContext
impl Unpin for SequenceContext
impl UnsafeUnpin for SequenceContext
impl UnwindSafe for SequenceContext
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