pub struct LoadCapture {
pub name: String,
pub source: LoadCaptureSource,
pub expression: String,
pub default_value: Option<String>,
}Expand description
A declarative cross-step capture / correlation rule: extracts a value from a
step’s response and binds it to a variable name a later step in the same
iteration can reference via $iteration.captured.<name>. Best-effort. Maps
to the LoadCapture schema.
Fields§
§name: StringThe variable name later steps reference.
source: LoadCaptureSourceWhere to extract from.
expression: StringThe JSONPath, header name, or regex driving the extraction.
default_value: Option<String>Optional fallback value bound when extraction yields nothing.
Implementations§
Source§impl LoadCapture
impl LoadCapture
Sourcepub fn new(
name: impl Into<String>,
source: LoadCaptureSource,
expression: impl Into<String>,
) -> Self
pub fn new( name: impl Into<String>, source: LoadCaptureSource, expression: impl Into<String>, ) -> Self
Create a capture binding name to the value extracted from source via
expression.
Sourcepub fn default_value(self, default_value: impl Into<String>) -> Self
pub fn default_value(self, default_value: impl Into<String>) -> Self
Set the fallback value bound to the variable on no match.
Trait Implementations§
Source§impl Clone for LoadCapture
impl Clone for LoadCapture
Source§fn clone(&self) -> LoadCapture
fn clone(&self) -> LoadCapture
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LoadCapture
impl Debug for LoadCapture
Source§impl<'de> Deserialize<'de> for LoadCapture
impl<'de> Deserialize<'de> for LoadCapture
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
Source§impl PartialEq for LoadCapture
impl PartialEq for LoadCapture
Source§fn eq(&self, other: &LoadCapture) -> bool
fn eq(&self, other: &LoadCapture) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for LoadCapture
impl Serialize for LoadCapture
impl StructuralPartialEq for LoadCapture
Auto Trait Implementations§
impl Freeze for LoadCapture
impl RefUnwindSafe for LoadCapture
impl Send for LoadCapture
impl Sync for LoadCapture
impl Unpin for LoadCapture
impl UnsafeUnpin for LoadCapture
impl UnwindSafe for LoadCapture
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