pub struct MethodFilter(/* private fields */);Expand description
axum::routing::MethodFilter re-export A filter that matches one or more HTTP methods.
Implementations§
Source§impl MethodFilter
 
impl MethodFilter
Sourcepub const CONNECT: MethodFilter
 
pub const CONNECT: MethodFilter
Match CONNECT requests.
This is useful for implementing HTTP/2’s [extended CONNECT method],
in which the :protocol pseudoheader is read
(using hyper::ext::Protocol)
and the connection upgraded to a bidirectional byte stream
(using hyper::upgrade::on).
As seen in the HTTP Upgrade Token Registry,
common uses include WebSockets and proxying UDP or IP –
though note that when using WebSocketUpgrade
it’s more useful to use any
as HTTP/1.1 WebSockets need to support GET.
Sourcepub const DELETE: MethodFilter
 
pub const DELETE: MethodFilter
Match DELETE requests.
Sourcepub const GET: MethodFilter
 
pub const GET: MethodFilter
Match GET requests.
Sourcepub const HEAD: MethodFilter
 
pub const HEAD: MethodFilter
Match HEAD requests.
Sourcepub const OPTIONS: MethodFilter
 
pub const OPTIONS: MethodFilter
Match OPTIONS requests.
Sourcepub const PATCH: MethodFilter
 
pub const PATCH: MethodFilter
Match PATCH requests.
Sourcepub const POST: MethodFilter
 
pub const POST: MethodFilter
Match POST requests.
Sourcepub const PUT: MethodFilter
 
pub const PUT: MethodFilter
Match PUT requests.
Sourcepub const TRACE: MethodFilter
 
pub const TRACE: MethodFilter
Match TRACE requests.
Sourcepub const fn or(self, other: MethodFilter) -> MethodFilter
 
pub const fn or(self, other: MethodFilter) -> MethodFilter
Performs the OR operation between the MethodFilter in self with other.
Trait Implementations§
Source§impl Clone for MethodFilter
 
impl Clone for MethodFilter
Source§fn clone(&self) -> MethodFilter
 
fn clone(&self) -> MethodFilter
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
 
fn clone_from(&mut self, source: &Self)
source. Read more