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