[][src]Trait httptest::matchers::Matcher

pub trait Matcher<IN>: Send where
    IN: ?Sized
{ pub fn matches(&mut self, input: &IN, ctx: &mut ExecutionContext) -> bool;
pub fn fmt(&self, f: &mut Formatter<'_>) -> Result; }

The core trait. Defines how an input value should be turned into an output value. This allows for a flexible pattern of composition where two or more matchers are chained together to form a readable and flexible manipulation.

Required methods

pub fn matches(&mut self, input: &IN, ctx: &mut ExecutionContext) -> bool[src]

Map an input to output.

pub fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

formatted name of the mapper. This is used for debugging purposes and should typically look like a fmt::Debug representation.

Loading content...

Implementations on Foreign Types

impl<IN: ?Sized> Matcher<IN> for &str where
    IN: AsRef<[u8]>, 
[src]

A &str is an implicit Eq mapper.

impl<IN: ?Sized> Matcher<IN> for String where
    IN: AsRef<[u8]>, 
[src]

A String is an implicit Eq mapper.

impl<IN: ?Sized> Matcher<IN> for &[u8] where
    IN: AsRef<[u8]>, 
[src]

A &u8 is an implicit Eq mapper.

impl<K: ?Sized, V: ?Sized, KMatcher, VMatcher> Matcher<KV<K, V>> for (KMatcher, VMatcher) where
    K: ToOwned + Debug,
    V: ToOwned + Debug,
    KMatcher: Matcher<K>,
    VMatcher: Matcher<V>, 
[src]

Loading content...

Implementors

impl<IN> Matcher<IN> for Any where
    IN: ?Sized
[src]

impl<IN, F> Matcher<IN> for F where
    F: Fn(&IN) -> bool + Send
[src]

impl<IN: ?Sized> Matcher<IN> for AllOf<IN> where
    IN: Debug
[src]

impl<IN: ?Sized> Matcher<IN> for AnyOf<IN> where
    IN: Debug
[src]

impl<IN: ?Sized> Matcher<IN> for Matches where
    IN: AsRef<[u8]>, 
[src]

impl<IN: ?Sized, M> Matcher<IN> for Lowercase<M> where
    IN: AsRef<[u8]>,
    M: Matcher<[u8]>, 
[src]

impl<IN: ?Sized, M> Matcher<IN> for UrlDecoded<M> where
    IN: AsRef<[u8]>,
    M: Matcher<[KV<str, str>]>, 
[src]

impl<IN: ?Sized, T, M> Matcher<IN> for JsonDecoded<T, M> where
    IN: AsRef<[u8]>,
    M: Matcher<T>,
    T: DeserializeOwned + Debug + Send
[src]

impl<IN: ?Sized, T: ?Sized> Matcher<IN> for Eq<T> where
    T: Borrow<IN> + Debug + Send,
    IN: PartialEq
[src]

impl<M> Matcher<str> for Len<M> where
    M: Matcher<usize>, 
[src]

impl<M> Matcher<BStr> for Len<M> where
    M: Matcher<usize>, 
[src]

impl<M, B> Matcher<Request<B>> for Body<M> where
    B: AsRef<[u8]>,
    M: Matcher<BStr>, 
[src]

impl<M, B> Matcher<Request<B>> for Headers<M> where
    M: Matcher<[KV<str, BStr>]>, 
[src]

impl<M, B> Matcher<Request<B>> for Method<M> where
    M: Matcher<str>, 
[src]

impl<M, B> Matcher<Request<B>> for Path<M> where
    M: Matcher<str>, 
[src]

impl<M, B> Matcher<Request<B>> for Query<M> where
    M: Matcher<str>, 
[src]

impl<M, E> Matcher<[E]> for Contains<M> where
    M: Matcher<E>,
    E: Debug
[src]

impl<M, IN: ?Sized> Matcher<IN> for Not<M> where
    M: Matcher<IN>,
    IN: Debug
[src]

impl<M, K: ?Sized, V: ?Sized> Matcher<KV<K, V>> for Key<M> where
    K: ToOwned + Debug,
    V: ToOwned,
    M: Matcher<K>, 
[src]

impl<M, K: ?Sized, V: ?Sized> Matcher<KV<K, V>> for Value<M> where
    K: ToOwned,
    V: ToOwned + Debug,
    M: Matcher<V>, 
[src]

impl<M, P, B> Matcher<Request<B>> for MethodPath<M, P> where
    M: Matcher<str>,
    P: Matcher<str>, 
[src]

impl<M, T> Matcher<[T]> for Len<M> where
    M: Matcher<usize>, 
[src]

Loading content...