[][src]Struct actix_web::http::Method

pub struct Method(_);

The Request Method (VERB)

This type also contains constants for a number of common HTTP methods such as GET, POST, etc.

Currently includes 8 variants representing the 8 methods defined in RFC 7230, plus PATCH, and an Extension variant for all extensions.

Examples

use http::Method;

assert_eq!(Method::GET, Method::from_bytes(b"GET").unwrap());
assert!(Method::GET.is_idempotent());
assert_eq!(Method::POST.as_str(), "POST");

Methods

impl Method
[src]

GET

POST

PUT

DELETE

HEAD

OPTIONS

CONNECT

PATCH

TRACE

Converts a slice of bytes to an HTTP method.

Whether a method is considered "safe", meaning the request is essentially read-only.

See the spec for more words.

Whether a method is considered "idempotent", meaning the request has the same result if executed multiple times.

See the spec for more words.

Return a &str representation of the HTTP method

Trait Implementations

impl Debug for Method
[src]

Formats the value using the given formatter. Read more

impl Hash for Method
[src]

Feeds this value into the given [Hasher]. Read more

Feeds a slice of this type into the given [Hasher]. Read more

impl Default for Method
[src]

Returns the "default value" for a type. Read more

impl Eq for Method
[src]

impl<'a> PartialEq<&'a str> 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<'a> PartialEq<&'a Method> 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 PartialEq<str> 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<'a> PartialEq<Method> for &'a Method
[src]

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

This method tests for !=.

impl PartialEq<Method> 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 Display for Method
[src]

Formats the value using the given formatter. Read more

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 AsRef<str> for Method
[src]

Performs the conversion.

impl HttpTryFrom<Method> for Method
[src]

Associated error with the conversion this implementation represents.

impl<'a> HttpTryFrom<&'a [u8]> for Method
[src]

Associated error with the conversion this implementation represents.

impl<'a> HttpTryFrom<&'a Method> for Method
[src]

Associated error with the conversion this implementation represents.

impl<'a> HttpTryFrom<&'a str> for Method
[src]

Associated error with the conversion this implementation represents.

impl<'a> From<&'a Method> for Method
[src]

Performs the conversion.

impl Clone for Method
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl Send for Method

impl Sync for Method

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T> ToString for T where
    T: Display + ?Sized
[src]

Converts the given value to a String. Read more

impl<T> From for T
[src]

Performs the conversion.

impl<T, U> Into for T where
    U: From<T>, 
[src]

Performs the conversion.

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

impl<T> Borrow for T where
    T: ?Sized
[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut for T where
    T: ?Sized
[src]

Mutably borrows from an owned value. Read more

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

🔬 This is a nightly-only experimental API. (get_type_id)

this method will likely be replaced by an associated static

Gets the TypeId of self. Read more

impl<T> Erased for T

impl<Q, K> Equivalent for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

Compare self to key and return true if they are equal.