Struct gotham::router::route::matcher::MethodOnlyRouteMatcher [−][src]
pub struct MethodOnlyRouteMatcher { /* fields omitted */ }
Expand description
A RouteMatcher
that succeeds when the Request
has been made with an accepted HTTP request
method.
Examples
let methods = vec![Method::GET, Method::HEAD];
let matcher = MethodOnlyRouteMatcher::new(methods);
state.put(Method::GET);
assert!(matcher.is_match(&state).is_ok());
state.put(Method::POST);
assert!(matcher.is_match(&state).is_err());
Implementations
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for MethodOnlyRouteMatcher
impl Send for MethodOnlyRouteMatcher
impl Sync for MethodOnlyRouteMatcher
impl Unpin for MethodOnlyRouteMatcher
impl UnwindSafe for MethodOnlyRouteMatcher
Blanket Implementations
Mutably borrows from an owned value. Read more
type Output = M
type Output = M
The concrete RouteMatcher each implementation will provide.
Transform into a RouteMatcher
of the the associated type identified by Output
.
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more