Enum rocket_governor::Method [−]
pub enum Method { Get, Put, Post, Delete, Options, Head, Trace, Connect, Patch, }
Expand description
Representation of HTTP methods.
Variants
The GET
variant.
The PUT
variant.
The POST
variant.
The DELETE
variant.
The OPTIONS
variant.
The HEAD
variant.
The TRACE
variant.
The CONNECT
variant.
The PATCH
variant.
Implementations
impl Method
impl Method
pub fn supports_payload(self) -> bool
pub fn supports_payload(self) -> bool
Returns true
if an HTTP request with the method represented by self
always supports a payload.
The following methods always support payloads:
PUT
,POST
,DELETE
,PATCH
The following methods do not always support payloads:
GET
,HEAD
,CONNECT
,TRACE
,OPTIONS
Example
use rocket::http::Method; assert_eq!(Method::Get.supports_payload(), false); assert_eq!(Method::Post.supports_payload(), true);
Trait Implementations
type Error = Infallible
type Error = Infallible
The associated error to be returned if derivation fails.
Derives an instance of Self
from the incoming request metadata. Read more
impl StructuralEq for Method
impl StructuralPartialEq for Method
Auto Trait Implementations
impl RefUnwindSafe for Method
impl UnwindSafe for Method
Blanket Implementations
Mutably borrows from an owned value. Read more
Compare self to key
and return true
if they are equal.
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
pub fn into_collection<A>(self) -> SmallVec<A> where
A: Array<Item = T>,
pub fn into_collection<A>(self) -> SmallVec<A> where
A: Array<Item = T>,
Converts self
into a collection.
pub fn vzip(self) -> V