[−][src]Enum mockito::Matcher
Allows matching the request path or headers in multiple ways: matching the exact value, matching any value (as long as it is present), matching by regular expression or checking that a particular header is missing.
These matchers are used within the mock
and Mock::match_header
calls.
Variants
Exact(String)
Matches the exact path or header value. There's also an implementation of From<&str>
to keep things simple and backwards compatible.
Regex(String)
Matches a path or header value by a regular expression.
Json(Value)
Matches a specified JSON body from a serde_json::Value
JsonString(String)
Matches a specified JSON body from a String
PartialJson(Value)
Matches a partial JSON body from a serde_json::Value
PartialJsonString(String)
Matches a specified partial JSON body from a String
Matches a URL-encoded key/value pair, where both key and value should be specified in plain (unencoded) format
At least one matcher must match
All matchers must match
Matches any path or any header value.
Checks that a header is not present in the request.
Trait Implementations
impl Clone for Matcher
[src]
impl PartialEq<Matcher> for Matcher
[src]
impl<'a> From<&'a str> for Matcher
[src]
impl Debug for Matcher
[src]
Auto Trait Implementations
impl Send for Matcher
impl Unpin for Matcher
impl Sync for Matcher
impl UnwindSafe for Matcher
impl RefUnwindSafe for Matcher
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,