[−][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
UrlEncoded(String, String)
Matches a URL-encoded key/value pair, where both key and value should be specified in plain (unencoded) format
AnyOf(Vec<Matcher>)
At least one matcher must match
AllOf(Vec<Matcher>)
All matchers must match
Any
Matches any path or any header value.
Missing
Checks that a header is not present in the request.
Trait Implementations
impl PartialEq<Matcher> for Matcher
[src]
impl<'a> From<&'a str> for Matcher
[src]
impl Clone for Matcher
[src]
fn clone(&self) -> Matcher
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for Matcher
[src]
Auto Trait Implementations
impl Sync for Matcher
impl Send for Matcher
impl Unpin for Matcher
impl RefUnwindSafe for Matcher
impl UnwindSafe 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>,