pub enum CaptureSource {
JsonPath(String),
Header {
header: String,
},
Status {
status: bool,
},
}Expand description
Where one capture entry reads its value from.
A bare string is the original and default form: a JSON path into the
response body. The two additive forms are objects, so a bare string can
never be confused with them: header: Set-Cookie reads a response
header, and status: true reads the numeric status code.
status: false is rejected at parse time (a request file that says it
does not want the status captured this way is not saying anything a
schema should represent) rather than left to fail silently at evaluate
time — the same call FollowRedirects
makes for a negative hop count.
Variants§
JsonPath(String)
The default, bare-string form: a JSON path into the response body.
Header
An object form: header: <name>. Matched case-insensitively against
Response::headers, the way
assertions matches header names.
Status
An object form: status: true. Captures the response’s numeric
status code, rendered as a string ("404", not 404).
Trait Implementations§
Source§impl Clone for CaptureSource
impl Clone for CaptureSource
Source§fn clone(&self) -> CaptureSource
fn clone(&self) -> CaptureSource
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CaptureSource
impl Debug for CaptureSource
Source§impl<'de> Deserialize<'de> for CaptureSource
impl<'de> Deserialize<'de> for CaptureSource
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>,
impl Eq for CaptureSource
Source§impl PartialEq for CaptureSource
impl PartialEq for CaptureSource
Source§impl Serialize for CaptureSource
impl Serialize for CaptureSource
impl StructuralPartialEq for CaptureSource
Auto Trait Implementations§
impl Freeze for CaptureSource
impl RefUnwindSafe for CaptureSource
impl Send for CaptureSource
impl Sync for CaptureSource
impl Unpin for CaptureSource
impl UnsafeUnpin for CaptureSource
impl UnwindSafe for CaptureSource
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.