[][src]Enum mockito::Matcher

pub enum Matcher {
    Exact(String),
    Regex(String),
    Json(Value),
    JsonString(String),
    AnyOf(Vec<Matcher>),
    Any,
    Missing,
}

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

AnyOf(Vec<Matcher>)

At least one must match

Any

Matches any path or any header value.

Missing

Checks that a header is not present in the request.

Trait Implementations

impl Clone for Matcher[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

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 Sync for Matcher

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]