Enum rocket::http::Method [] [src]

pub enum Method {
    Get,
    Put,
    Post,
    Delete,
    Options,
    Head,
    Trace,
    Connect,
    Patch,
}

Representation of HTTP methods.

Variants

Methods

impl Method
[src]

Returns true ff an HTTP request with the method represented by self supports a payload.

Example

use rocket::http::Method;

assert_eq!(Method::Get.supports_payload(), false);
assert_eq!(Method::Post.supports_payload(), true);

Returns the string representation of self.

Example

use rocket::http::Method;

assert_eq!(Method::Get.as_str(), "GET");

Trait Implementations

impl Clone for Method
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Copy for Method
[src]

impl PartialEq for Method
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Eq for Method
[src]

impl Hash for Method
[src]

Feeds this value into the state given, updating the hasher as necessary.

Feeds a slice of this type into the state provided.

impl Debug for Method
[src]

Formats the value using the given formatter.

impl FromStr for Method
[src]

The associated error which can be returned from parsing.

Parses a string s to return a value of this type. Read more

impl Display for Method
[src]

Formats the value using the given formatter.

impl<'a, 'r> FromRequest<'a, 'r> for Method
[src]

The associated error to be returned if derivation fails.

Derives an instance of Self from the incoming request metadata. Read more