[−][src]Trait httptest::mappers::Mapper
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.
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.
Implementations on Foreign Types
impl<'_, IN: ?Sized> Mapper<IN> for &'_ str where
IN: AsRef<[u8]>,
[src]
IN: AsRef<[u8]>,
A &str is an implicit Eq mapper.
type Out = bool
fn map(&mut self, input: &IN) -> bool
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
impl<IN: ?Sized> Mapper<IN> for String where
IN: AsRef<[u8]>,
[src]
IN: AsRef<[u8]>,
A String is an implicit Eq mapper.
type Out = bool
fn map(&mut self, input: &IN) -> bool
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
impl<'_, IN: ?Sized> Mapper<IN> for &'_ [u8] where
IN: AsRef<[u8]>,
[src]
IN: AsRef<[u8]>,
A &u8 is an implicit Eq mapper.
type Out = bool
fn map(&mut self, input: &IN) -> bool
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
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]
K: ToOwned,
V: ToOwned,
KMapper: Mapper<K, Out = bool>,
VMapper: Mapper<V, Out = bool>,
type Out = bool
fn map(&mut self, input: &KV<K, V>) -> bool
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
Implementors
impl<IN> Mapper<IN> for AllOf<IN> where
IN: ?Sized,
[src]
IN: ?Sized,
type Out = bool
fn map(&mut self, input: &IN) -> bool
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
impl<IN> Mapper<IN> for Any where
IN: ?Sized,
[src]
IN: ?Sized,
type Out = bool
fn map(&mut self, _input: &IN) -> bool
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
impl<IN> Mapper<IN> for AnyOf<IN> where
IN: ?Sized,
[src]
IN: ?Sized,
type Out = bool
fn map(&mut self, input: &IN) -> bool
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
impl<IN, F> Mapper<IN> for F where
F: Fn(&IN) -> bool + Send,
[src]
F: Fn(&IN) -> bool + Send,
type Out = bool
fn map(&mut self, input: &IN) -> bool
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
impl<IN: ?Sized> Mapper<IN> for Matches where
IN: AsRef<[u8]>,
[src]
IN: AsRef<[u8]>,
type Out = bool
fn map(&mut self, input: &IN) -> bool
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
impl<IN: ?Sized, M> Mapper<IN> for Inspect<M> where
IN: Debug,
M: Mapper<IN>,
M::Out: Debug,
[src]
IN: Debug,
M: Mapper<IN>,
M::Out: Debug,
type Out = M::Out
fn map(&mut self, input: &IN) -> M::Out
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
impl<IN: ?Sized, M> Mapper<IN> for Lowercase<M> where
IN: AsRef<[u8]>,
M: Mapper<[u8]>,
[src]
IN: AsRef<[u8]>,
M: Mapper<[u8]>,
type Out = M::Out
fn map(&mut self, input: &IN) -> M::Out
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
impl<IN: ?Sized, M> Mapper<IN> for UrlDecoded<M> where
IN: AsRef<[u8]>,
M: Mapper<[KV<str, str>]>,
[src]
IN: AsRef<[u8]>,
M: Mapper<[KV<str, str>]>,
type Out = M::Out
fn map(&mut self, input: &IN) -> M::Out
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
impl<IN: ?Sized, T, M> Mapper<IN> for JsonDecoded<T, M> where
IN: AsRef<[u8]>,
M: Mapper<T, Out = bool>,
T: DeserializeOwned + Send,
[src]
IN: AsRef<[u8]>,
M: Mapper<T, Out = bool>,
T: DeserializeOwned + Send,
type Out = bool
fn map(&mut self, input: &IN) -> bool
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
impl<IN: ?Sized, T: ?Sized> Mapper<IN> for Eq<T> where
T: Borrow<IN> + Debug + Send,
IN: PartialEq,
[src]
T: Borrow<IN> + Debug + Send,
IN: PartialEq,
type Out = bool
fn map(&mut self, input: &IN) -> bool
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
impl<M> Mapper<str> for Len<M> where
M: Mapper<usize>,
[src]
M: Mapper<usize>,
type Out = M::Out
fn map(&mut self, input: &str) -> M::Out
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
impl<M, B> Mapper<Request<B>> for Path<M> where
M: Mapper<str>,
[src]
M: Mapper<str>,
type Out = M::Out
fn map(&mut self, input: &Request<B>) -> M::Out
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
impl<M, B> Mapper<Request<B>> for Query<M> where
M: Mapper<str>,
[src]
M: Mapper<str>,
type Out = M::Out
fn map(&mut self, input: &Request<B>) -> M::Out
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
impl<M, B> Mapper<Request<B>> for Method<M> where
M: Mapper<str>,
[src]
M: Mapper<str>,
type Out = M::Out
fn map(&mut self, input: &Request<B>) -> M::Out
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
impl<M, B> Mapper<Request<B>> for Body<M> where
B: ToOwned,
M: Mapper<B::Owned>,
[src]
B: ToOwned,
M: Mapper<B::Owned>,
type Out = M::Out
fn map(&mut self, input: &Request<B>) -> M::Out
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
impl<M, B> Mapper<Request<B>> for Headers<M> where
M: Mapper<[KV<str, [u8]>]>,
[src]
M: Mapper<[KV<str, [u8]>]>,
type Out = M::Out
fn map(&mut self, input: &Request<B>) -> M::Out
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
impl<M, E> Mapper<[E]> for Contains<M> where
M: Mapper<E, Out = bool>,
[src]
M: Mapper<E, Out = bool>,
type Out = bool
fn map(&mut self, input: &[E]) -> bool
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
impl<M, IN> Mapper<IN> for Not<M> where
M: Mapper<IN, Out = bool>,
IN: ?Sized,
[src]
M: Mapper<IN, Out = bool>,
IN: ?Sized,
type Out = bool
fn map(&mut self, input: &IN) -> bool
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
impl<M, K: ?Sized, V: ?Sized> Mapper<KV<K, V>> for Key<M> where
K: ToOwned,
V: ToOwned,
M: Mapper<K>,
[src]
K: ToOwned,
V: ToOwned,
M: Mapper<K>,
type Out = M::Out
fn map(&mut self, input: &KV<K, V>) -> M::Out
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
impl<M, K: ?Sized, V: ?Sized> Mapper<KV<K, V>> for Value<M> where
K: ToOwned,
V: ToOwned,
M: Mapper<V>,
[src]
K: ToOwned,
V: ToOwned,
M: Mapper<V>,
type Out = M::Out
fn map(&mut self, input: &KV<K, V>) -> M::Out
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
impl<M, P, B> Mapper<Request<B>> for MethodPath<M, P> where
M: Mapper<str, Out = bool>,
P: Mapper<str, Out = bool>,
[src]
M: Mapper<str, Out = bool>,
P: Mapper<str, Out = bool>,
type Out = bool
fn map(&mut self, input: &Request<B>) -> M::Out
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
impl<M, T> Mapper<[T]> for Len<M> where
M: Mapper<usize>,
[src]
M: Mapper<usize>,