[−][src]Enum ctchi::core::http::HttpMethod
Represent HTTP method + unknown value in case we are missing something in enum or client send us wrong request.
Variants
Implementations
impl HttpMethod
[src]
pub fn parse(method_str: &str) -> HttpMethod
[src]
Build HttpMethod enum from string. If it is valid HTTP method we get appropriate value. Otherwise we get HttpMethod::UNKNOWN
Arguments:
method_str
- string which contains HTTP method representation
Example
use ctchi::core::http::HttpMethod; assert!(HttpMethod::parse("GET") == HttpMethod::GET); assert!(HttpMethod::parse("POST") == HttpMethod::POST); assert!(HttpMethod::parse("PUT") == HttpMethod::PUT); assert!(HttpMethod::parse("SOMETHING") == HttpMethod::UNKNOWN);
Trait Implementations
impl PartialEq<HttpMethod> for HttpMethod
[src]
impl StructuralPartialEq for HttpMethod
[src]
Auto Trait Implementations
impl RefUnwindSafe for HttpMethod
impl Send for HttpMethod
impl Sync for HttpMethod
impl Unpin for HttpMethod
impl UnwindSafe for HttpMethod
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,