[][src]Enum mockito::Matcher

pub enum Matcher {
    Exact(String),
    Regex(String),
    Json(Value),
    JsonString(String),
    UrlEncoded(StringString),
    AnyOf(Vec<Matcher>),
    AllOf(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

UrlEncoded(StringString)

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_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]

type Owned = T

The resulting type after obtaining ownership.

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

impl<T> From<T> for T[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.

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

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

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

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,