[][src]Struct saphir::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<'a> PartialEq<&'a Method> for Method
[src]

This method tests for !=.

impl PartialEq<Method> for str
[src]

This method tests for !=.

impl PartialEq<Method> for Method
[src]

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

This method tests for !=.

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

This method tests for !=.

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

This method tests for !=.

impl PartialEq<str> for Method
[src]

This method tests for !=.

impl Eq for Method
[src]

impl Debug for Method
[src]

impl Hash for Method
[src]

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

impl Clone for Method
[src]

Performs copy-assignment from source. Read more

impl Default for Method
[src]

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

Associated error with the conversion this implementation represents.

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

The associated error which can be returned from parsing.

impl AsRef<str> for Method
[src]

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

impl Display for Method
[src]

impl From<Method> for Method
[src]

impl From<Method> for Method
[src]

Auto Trait Implementations

impl Send for Method

impl Sync for Method

Blanket Implementations

impl<T> From for T
[src]

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

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

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

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.

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

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

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.

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

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

impl<T> Erased for T