pub enum Method {
Get,
Put,
Post,
Delete,
Options,
Head,
Trace,
Connect,
Patch,
}
Expand description
Representation of HTTP methods.
Variants§
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§
source§impl<'a, 'r> FromRequest<'a, 'r> for Method
impl<'a, 'r> FromRequest<'a, 'r> for Method
impl Copy for Method
impl Eq for Method
impl StructuralPartialEq for Method
Auto Trait Implementations§
impl Freeze for Method
impl RefUnwindSafe for Method
impl Send for Method
impl Sync for Method
impl Unpin for Method
impl UnwindSafe for Method
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.