[][src]Trait httptest::mappers::Mapper

pub trait Mapper<IN>: Send + Debug where
    IN: ?Sized
{ type Out; fn map(&mut self, input: &IN) -> Self::Out; }

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 mappers are chained together to form a readable and flexible manipulation.

There is a special case of a Mapper that outputs a bool that is called a Matcher.

Associated Types

type Out

The output type.

Loading content...

Required methods

fn map(&mut self, input: &IN) -> Self::Out

Map an input to output.

Loading content...

Implementations on Foreign Types

impl<K, V, KMapper, VMapper> Mapper<(K, V)> for (KMapper, VMapper) where
    KMapper: Mapper<K, Out = bool>,
    VMapper: Mapper<V, Out = bool>, 
[src]

type Out = bool

Loading content...

Implementors

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

type Out = bool

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

type Out = bool

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

type Out = bool

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

type Out = bool

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

type Out = bool

impl<IN: ?Sized, M> Mapper<IN> for Inspect<M> where
    IN: Debug,
    M: Mapper<IN>,
    M::Out: Debug
[src]

type Out = M::Out

impl<IN: ?Sized, M> Mapper<IN> for JsonDecoded<M> where
    IN: AsRef<[u8]>,
    M: Mapper<Value>, 
[src]

type Out = M::Out

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

type Out = M::Out

impl<IN: ?Sized, M> Mapper<IN> for UrlDecoded<M> where
    IN: AsRef<[u8]>,
    M: Mapper<[(String, String)]>, 
[src]

type Out = M::Out

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

type Out = bool

impl<M, B> Mapper<Response<B>> for httptest::mappers::response::Body<M> where
    M: Mapper<B>, 
[src]

type Out = M::Out

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

type Out = M::Out

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

type Out = M::Out

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

type Out = M::Out

impl<M, B> Mapper<Request<B>> for httptest::mappers::request::Body<M> where
    B: ToOwned,
    M: Mapper<B::Owned>, 
[src]

type Out = M::Out

impl<M, B> Mapper<Request<B>> for httptest::mappers::request::Headers<M> where
    M: Mapper<[(Vec<u8>, Vec<u8>)]>, 
[src]

type Out = M::Out

impl<M, B> Mapper<Response<B>> for httptest::mappers::response::Headers<M> where
    M: Mapper<[(Vec<u8>, Vec<u8>)]>, 
[src]

type Out = M::Out

impl<M, B> Mapper<Response<B>> for StatusCode<M> where
    M: Mapper<u16>, 
[src]

type Out = M::Out

impl<M, E> Mapper<[E]> for Contains<M> where
    M: Mapper<E, Out = bool>, 
[src]

type Out = bool

impl<M, IN> Mapper<IN> for Deref<M> where
    M: Mapper<IN::Target>,
    IN: Deref
[src]

type Out = M::Out

impl<M, IN> Mapper<IN> for Not<M> where
    M: Mapper<IN, Out = bool>,
    IN: ?Sized
[src]

type Out = bool

Loading content...