Struct MethodFilter

pub struct MethodFilter(/* private field */);

A filter that matches one or more HTTP methods.

Implementations

impl MethodFilter

const CONNECT: Self = _;

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.

const DELETE: Self = _;

Match DELETE requests.

const GET: Self = _;

Match GET requests.

const HEAD: Self = _;

Match HEAD requests.

const OPTIONS: Self = _;

Match OPTIONS requests.

const PATCH: Self = _;

Match PATCH requests.

const POST: Self = _;

Match POST requests.

const PUT: Self = _;

Match PUT requests.

const TRACE: Self = _;

Match TRACE requests.

const fn or(self, other: Self) -> Self

Performs the OR operation between the MethodFilter in self with other.

Trait Implementations

impl Clone for MethodFilter

fn clone(&self) -> MethodFilter

impl Copy for MethodFilter

impl Debug for MethodFilter

fn fmt(&self, f: &mut Formatter<'_>) -> Result

impl PartialEq for MethodFilter

fn eq(&self, other: &MethodFilter) -> bool

impl StructuralPartialEq for MethodFilter

impl TryFrom<Method> for MethodFilter

type Error = NoMatchingMethodFilter;
fn try_from(m: Method) -> Result<Self, NoMatchingMethodFilter>

Auto Trait Implementations

impl Freeze for MethodFilter

impl RefUnwindSafe for MethodFilter

impl Send for MethodFilter

impl Sync for MethodFilter

impl Unpin for MethodFilter

impl UnsafeUnpin for MethodFilter

impl UnwindSafe for MethodFilter

Blanket Implementations

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for MethodFilter where ST: ?Sized, DT: ?Sized,

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for MethodFilter where ST: ?Sized, DT: ?Sized,

impl<T> Any for MethodFilter where T: 'static + ?Sized,

fn type_id(&self) -> TypeId

impl<T> Borrow<T> for MethodFilter where T: ?Sized,

fn borrow(&self) -> &T

impl<T> BorrowMut<T> for MethodFilter where T: ?Sized,

fn borrow_mut(&mut self) -> &mut T

impl<T> CloneToUninit for MethodFilter where T: Clone,

unsafe fn clone_to_uninit(&self, dest: *mut u8)

impl<T> From<T> for MethodFilter

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> FromRef<T> for MethodFilter where T: Clone,

fn from_ref(input: &T) -> T

impl<T> Instrument for MethodFilter

impl<T> Read<Exclusive, BecauseExclusive> for MethodFilter where T: ?Sized,

impl<T> Same for MethodFilter

type Output = T;

impl<T> ToOwned for MethodFilter where T: Clone,

type Owned = T;
fn to_owned(&self) -> T
fn clone_into(&self, target: &mut T)

impl<T> WithSubscriber for MethodFilter

impl<T, U> Into<U> for MethodFilter where U: From<T>,

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom<U> for MethodFilter where U: Into<T>,

type Error = never;
fn try_from(value: U) -> Result<T, never>

impl<T, U> TryInto<U> for MethodFilter where U: TryFrom<T>,

type Error = <U as TryFrom<T>>::Error;
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

impl<V, T> VZip<V> for MethodFilter where V: MultiLane<T>,

fn vzip(self) -> V