Module matcher
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::orandMatcher::andtrait methods. - These all serve as building blocks together with
And,Or,Notand a bool to combine and transform any kind ofMatcher. - And finally there is
MatchFn, easily created usingmatch_fnto create aMatcherfrom any compatibleFn.
Structs§
- And
- A matcher that matches if all of the inner matchers match.
- Extension
Matcher - 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). - Matcher
Router - Wrapper type that can be used to turn a tuple of (
Matcher,Service) tuples into a singleService. - Not
- A matcher that matches if the inner matcher does not match.
- Or
- A matcher that matches if any of the inner matchers match.
Traits§
- Iterator
Matcher Ext - Extension to apply matcher operations to an
IteratorofMatchers. - MatchFn
- A
MatchFnis aMatcherimplemented using a function. - Matcher
- A condition to decide whether
Requestwithin the given [Context] matches for router or other middleware purposes.