pub struct MethodFilter(/* private fields */);
Expand description
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
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for MethodFilter
impl Debug for MethodFilter
Source§impl PartialEq for MethodFilter
impl PartialEq for MethodFilter
Source§impl TryFrom<Method> for MethodFilter
impl TryFrom<Method> for MethodFilter
impl Copy for MethodFilter
impl StructuralPartialEq for MethodFilter
Auto Trait Implementations§
impl Freeze for MethodFilter
impl RefUnwindSafe for MethodFilter
impl Send for MethodFilter
impl Sync for MethodFilter
impl Unpin for MethodFilter
impl UnwindSafe for MethodFilter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more