[][src]Enum octane::request::HttpVersion

pub enum HttpVersion {
    Http11,
    Http10,
    Http02,
    Http09,
    HttpInvalid,
}

Holds the http versions you can match the variants by doing a comparison with the version in the request_line

Example

use octane::server::Octane;
use octane::{route, router::{Flow, Route}};
use octane::request::HttpVersion;

let mut app = Octane::new();
app
.get("/",
    route!(|req, res| {
       if req.request_line.version == HttpVersion::Http11 {
           // do something
        }
        Flow::Stop
    }),
);

Variants

Http11
Http10
Http02
Http09
HttpInvalid

Implementations

impl HttpVersion[src]

pub fn get_version_string(self) -> String[src]

Returns the version in string like "1.1" or "1.0" etc

Trait Implementations

impl Clone for HttpVersion[src]

impl Debug for HttpVersion[src]

impl Eq for HttpVersion[src]

impl PartialEq<HttpVersion> for HttpVersion[src]

impl StructuralEq for HttpVersion[src]

impl StructuralPartialEq for HttpVersion[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

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

type Owned = T

The resulting type after obtaining ownership.

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

type Error = Infallible

The type returned in the event of a conversion error.

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

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.