Expand description
matcher utilities for any middleware where need to match
on incoming requests within a given Context
This module provides the Matcher
trait and convenience utilities around it.
- Examples of this are iterator “reducers” as made available via
IteratorMatcherExt
, as well as optionalMatcher::or
andMatcher::and
trait methods. - These all serve as building blocks together with
And
,Or
,Not
and a bool to combine and transform any kind ofMatcher
. - And finally there is
MatchFn
, easily created usingmatch_fn
to create aMatcher
from any compatibleFn
.
Structs§
- A matcher that matches if all of the inner matchers match.
- A matcher which allows you to match based on an extension, either by comparing with an extension (
ExtensionMatcher::with_const
), or using a custom predicate (ExtensionMatcher::with_fn
). - A matcher that matches if the inner matcher does not match.
- A matcher that matches if any of the inner matchers match.
Traits§
- A condition to decide whether
Request
within the givenContext
matches for router or other middleware purposes.
Functions§
- Create a
MatchFn
from a function.