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

pub trait Mapper<IN>: Send where
    IN: ?Sized
{ type Out; fn map(&mut self, input: &IN) -> Self::Out;
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 mappers are chained together to form a readable and flexible manipulation.

Associated Types

type Out

The output type.

Loading content...

Required methods

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

Map an input to output.

fn fmt(&self, f: &mut Formatter) -> Result

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> Mapper<IN> for &'_ str where
    IN: AsRef<[u8]>, 
[src]

A &str is an implicit Eq mapper.

type Out = bool

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

A String is an implicit Eq mapper.

type Out = bool

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

A &u8 is an implicit Eq mapper.

type Out = bool

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

type Out = bool

Loading content...

Implementors

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

type Out = bool

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

type Out = bool

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

type Out = bool

impl<IN, F> Mapper<IN> for F where
    F: Fn(&IN) -> bool + Send
[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 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<[KV<str, str>]>, 
[src]

type Out = M::Out

impl<IN: ?Sized, T, M> Mapper<IN> for JsonDecoded<T, M> where
    IN: AsRef<[u8]>,
    M: Mapper<T, Out = bool>,
    T: DeserializeOwned + Send
[src]

type Out = bool

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

type Out = bool

impl<M> Mapper<str> for Len<M> where
    M: Mapper<usize>, 
[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 Body<M> where
    B: ToOwned,
    M: Mapper<B::Owned>, 
[src]

type Out = M::Out

impl<M, B> Mapper<Request<B>> for Headers<M> where
    M: Mapper<[KV<str, [u8]>]>, 
[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 Not<M> where
    M: Mapper<IN, Out = bool>,
    IN: ?Sized
[src]

type Out = bool

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

type Out = M::Out

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

type Out = M::Out

impl<M, P, B> Mapper<Request<B>> for MethodPath<M, P> where
    M: Mapper<str, Out = bool>,
    P: Mapper<str, Out = bool>, 
[src]

type Out = bool

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

type Out = M::Out

Loading content...