[−][src]Trait httptest::matchers::Matcher
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
fn matches(&mut self, input: &IN, ctx: &mut ExecutionContext) -> bool
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, '_> Matcher<IN> for &'_ str where
IN: AsRef<[u8]>,
[src]
IN: AsRef<[u8]>,
A &str is an implicit Eq mapper.
fn matches(&mut self, input: &IN, _ctx: &mut ExecutionContext) -> bool
[src]
fn fmt(&self, f: &mut Formatter<'_>) -> Result
[src]
impl<IN: ?Sized> Matcher<IN> for String where
IN: AsRef<[u8]>,
[src]
IN: AsRef<[u8]>,
A String is an implicit Eq mapper.
fn matches(&mut self, input: &IN, _ctx: &mut ExecutionContext) -> bool
[src]
fn fmt(&self, f: &mut Formatter<'_>) -> Result
[src]
impl<IN: ?Sized, '_> Matcher<IN> for &'_ [u8] where
IN: AsRef<[u8]>,
[src]
IN: AsRef<[u8]>,
A &u8 is an implicit Eq mapper.
fn matches(&mut self, input: &IN, _ctx: &mut ExecutionContext) -> bool
[src]
fn fmt(&self, f: &mut Formatter<'_>) -> Result
[src]
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]
K: ToOwned + Debug,
V: ToOwned + Debug,
KMatcher: Matcher<K>,
VMatcher: Matcher<V>,
fn matches(&mut self, input: &KV<K, V>, ctx: &mut ExecutionContext) -> bool
[src]
fn fmt(&self, f: &mut Formatter<'_>) -> Result
[src]
Implementors
impl<IN> Matcher<IN> for Any where
IN: ?Sized,
[src]
IN: ?Sized,
fn matches(&mut self, _input: &IN, _ctx: &mut ExecutionContext) -> bool
[src]
fn fmt(&self, f: &mut Formatter<'_>) -> Result
[src]
impl<IN, F> Matcher<IN> for F where
F: Fn(&IN) -> bool + Send,
[src]
F: Fn(&IN) -> bool + Send,
fn matches(&mut self, input: &IN, _ctx: &mut ExecutionContext) -> bool
[src]
fn fmt(&self, f: &mut Formatter<'_>) -> Result
[src]
impl<IN: ?Sized> Matcher<IN> for AllOf<IN> where
IN: Debug,
[src]
IN: Debug,
fn matches(&mut self, input: &IN, ctx: &mut ExecutionContext) -> bool
[src]
fn fmt(&self, f: &mut Formatter<'_>) -> Result
[src]
impl<IN: ?Sized> Matcher<IN> for AnyOf<IN> where
IN: Debug,
[src]
IN: Debug,
fn matches(&mut self, input: &IN, ctx: &mut ExecutionContext) -> bool
[src]
fn fmt(&self, f: &mut Formatter<'_>) -> Result
[src]
impl<IN: ?Sized> Matcher<IN> for Matches where
IN: AsRef<[u8]>,
[src]
IN: AsRef<[u8]>,
fn matches(&mut self, input: &IN, _ctx: &mut ExecutionContext) -> bool
[src]
fn fmt(&self, f: &mut Formatter<'_>) -> Result
[src]
impl<IN: ?Sized, M> Matcher<IN> for Lowercase<M> where
IN: AsRef<[u8]>,
M: Matcher<[u8]>,
[src]
IN: AsRef<[u8]>,
M: Matcher<[u8]>,
fn matches(&mut self, input: &IN, ctx: &mut ExecutionContext) -> bool
[src]
fn fmt(&self, f: &mut Formatter<'_>) -> Result
[src]
impl<IN: ?Sized, M> Matcher<IN> for UrlDecoded<M> where
IN: AsRef<[u8]>,
M: Matcher<[KV<str, str>]>,
[src]
IN: AsRef<[u8]>,
M: Matcher<[KV<str, str>]>,
fn matches(&mut self, input: &IN, ctx: &mut ExecutionContext) -> bool
[src]
fn fmt(&self, f: &mut Formatter<'_>) -> Result
[src]
impl<IN: ?Sized, T, M> Matcher<IN> for JsonDecoded<T, M> where
IN: AsRef<[u8]>,
M: Matcher<T>,
T: DeserializeOwned + Debug + Send,
[src]
IN: AsRef<[u8]>,
M: Matcher<T>,
T: DeserializeOwned + Debug + Send,
fn matches(&mut self, input: &IN, ctx: &mut ExecutionContext) -> bool
[src]
fn fmt(&self, f: &mut Formatter<'_>) -> Result
[src]
impl<IN: ?Sized, T: ?Sized> Matcher<IN> for Eq<T> where
T: Borrow<IN> + Debug + Send,
IN: PartialEq,
[src]
T: Borrow<IN> + Debug + Send,
IN: PartialEq,
fn matches(&mut self, input: &IN, _ctx: &mut ExecutionContext) -> bool
[src]
fn fmt(&self, f: &mut Formatter<'_>) -> Result
[src]
impl<M> Matcher<str> for Len<M> where
M: Matcher<usize>,
[src]
M: Matcher<usize>,
fn matches(&mut self, input: &str, ctx: &mut ExecutionContext) -> bool
[src]
fn fmt(&self, f: &mut Formatter<'_>) -> Result
[src]
impl<M> Matcher<BStr> for Len<M> where
M: Matcher<usize>,
[src]
M: Matcher<usize>,
fn matches(&mut self, input: &BStr, ctx: &mut ExecutionContext) -> bool
[src]
fn fmt(&self, f: &mut Formatter<'_>) -> Result
[src]
impl<M, B> Matcher<Request<B>> for Body<M> where
B: AsRef<[u8]>,
M: Matcher<BStr>,
[src]
B: AsRef<[u8]>,
M: Matcher<BStr>,
fn matches(&mut self, input: &Request<B>, ctx: &mut ExecutionContext) -> bool
[src]
fn fmt(&self, f: &mut Formatter<'_>) -> Result
[src]
impl<M, B> Matcher<Request<B>> for Headers<M> where
M: Matcher<[KV<str, BStr>]>,
[src]
M: Matcher<[KV<str, BStr>]>,
fn matches(&mut self, input: &Request<B>, ctx: &mut ExecutionContext) -> bool
[src]
fn fmt(&self, f: &mut Formatter<'_>) -> Result
[src]
impl<M, B> Matcher<Request<B>> for Method<M> where
M: Matcher<str>,
[src]
M: Matcher<str>,
fn matches(&mut self, input: &Request<B>, ctx: &mut ExecutionContext) -> bool
[src]
fn fmt(&self, f: &mut Formatter<'_>) -> Result
[src]
impl<M, B> Matcher<Request<B>> for Path<M> where
M: Matcher<str>,
[src]
M: Matcher<str>,
fn matches(&mut self, input: &Request<B>, ctx: &mut ExecutionContext) -> bool
[src]
fn fmt(&self, f: &mut Formatter<'_>) -> Result
[src]
impl<M, B> Matcher<Request<B>> for Query<M> where
M: Matcher<str>,
[src]
M: Matcher<str>,
fn matches(&mut self, input: &Request<B>, ctx: &mut ExecutionContext) -> bool
[src]
fn fmt(&self, f: &mut Formatter<'_>) -> Result
[src]
impl<M, E> Matcher<[E]> for Contains<M> where
M: Matcher<E>,
E: Debug,
[src]
M: Matcher<E>,
E: Debug,
fn matches(&mut self, input: &[E], ctx: &mut ExecutionContext) -> bool
[src]
fn fmt(&self, f: &mut Formatter<'_>) -> Result
[src]
impl<M, IN: ?Sized> Matcher<IN> for Not<M> where
M: Matcher<IN>,
IN: Debug,
[src]
M: Matcher<IN>,
IN: Debug,
fn matches(&mut self, input: &IN, ctx: &mut ExecutionContext) -> bool
[src]
fn fmt(&self, f: &mut Formatter<'_>) -> Result
[src]
impl<M, K: ?Sized, V: ?Sized> Matcher<KV<K, V>> for Key<M> where
K: ToOwned + Debug,
V: ToOwned,
M: Matcher<K>,
[src]
K: ToOwned + Debug,
V: ToOwned,
M: Matcher<K>,
fn matches(&mut self, input: &KV<K, V>, ctx: &mut ExecutionContext) -> bool
[src]
fn fmt(&self, f: &mut Formatter<'_>) -> Result
[src]
impl<M, K: ?Sized, V: ?Sized> Matcher<KV<K, V>> for Value<M> where
K: ToOwned,
V: ToOwned + Debug,
M: Matcher<V>,
[src]
K: ToOwned,
V: ToOwned + Debug,
M: Matcher<V>,
fn matches(&mut self, input: &KV<K, V>, ctx: &mut ExecutionContext) -> bool
[src]
fn fmt(&self, f: &mut Formatter<'_>) -> Result
[src]
impl<M, P, B> Matcher<Request<B>> for MethodPath<M, P> where
M: Matcher<str>,
P: Matcher<str>,
[src]
M: Matcher<str>,
P: Matcher<str>,
fn matches(&mut self, input: &Request<B>, ctx: &mut ExecutionContext) -> bool
[src]
fn fmt(&self, f: &mut Formatter<'_>) -> Result
[src]
impl<M, T> Matcher<[T]> for Len<M> where
M: Matcher<usize>,
[src]
M: Matcher<usize>,