[][src]Struct http_parser::parser::HttpRequestParser

pub struct HttpRequestParser<'a, S> where
    S: RequestParserState
{ packet: &'a str, request: Request<'a>, state: S, }

The Parser structure.

Fields

packet: &'a strrequest: Request<'a>state: S

Implementations

impl<'a, T> HttpRequestParser<'a, T> where
    T: RequestParserState
[src]

fn skip_spaces(&mut self)[src]

Skip existing spaces (other whitespace is not considered).

fn skip_crlf(&mut self) -> Result<(), ParsingError>[src]

If the next two characters are \r\n.

fn parse_until_char(&mut self, chr: u8) -> &'a str[src]

impl<'a, S> HttpRequestParser<'a, RequestLine<S>> where
    S: RequestLineParserState
[src]

pub fn start(packet: &'a str) -> HttpRequestParser<'a, RequestLine<Method>>[src]

Create a new HttpRequestParser which starts in RequestLine<Method>.

impl<'a> HttpRequestParser<'a, Header>[src]

fn parse_line(&mut self)[src]

Parse a line in the header.

Trait Implementations

impl<'a, S: Debug> Debug for HttpRequestParser<'a, S> where
    S: RequestParserState
[src]

impl<'a> Parse for HttpRequestParser<'a, RequestLine<Method>>[src]

type NextState = Result<HttpRequestParser<'a, RequestLine<Uri>>, ParsingError>

NextState type are of kind Parser<'a, State> Sadly we can't do type NextParser = Parser<'a, Self::NextState> and allow the final user to simply define type NextState until https://github.com/rust-lang/rust/issues/29661 is resolved. Read more

impl<'a> Parse for HttpRequestParser<'a, RequestLine<Uri>>[src]

type NextState = Result<HttpRequestParser<'a, RequestLine<Version>>, ParsingError>

NextState type are of kind Parser<'a, State> Sadly we can't do type NextParser = Parser<'a, Self::NextState> and allow the final user to simply define type NextState until https://github.com/rust-lang/rust/issues/29661 is resolved. Read more

impl<'a> Parse for HttpRequestParser<'a, RequestLine<Version>>[src]

type NextState = Result<HttpRequestParser<'a, Header>, ParsingError>

NextState type are of kind Parser<'a, State> Sadly we can't do type NextParser = Parser<'a, Self::NextState> and allow the final user to simply define type NextState until https://github.com/rust-lang/rust/issues/29661 is resolved. Read more

impl<'a> Parse for HttpRequestParser<'a, Header>[src]

type NextState = Result<HttpRequestParser<'a, Body>, ParsingError>

NextState type are of kind Parser<'a, State> Sadly we can't do type NextParser = Parser<'a, Self::NextState> and allow the final user to simply define type NextState until https://github.com/rust-lang/rust/issues/29661 is resolved. Read more

impl<'a> Parse for HttpRequestParser<'a, Body>[src]

type NextState = Request<'a>

Since the body is the last element of the request, the next possible state is final and thus returns the parsed request.

fn parse(self) -> Self::NextState[src]

Parse the body (which is composed of all remaining bytes) and return the next state.

Auto Trait Implementations

impl<'a, S> RefUnwindSafe for HttpRequestParser<'a, S> where
    S: RefUnwindSafe

impl<'a, S> Send for HttpRequestParser<'a, S> where
    S: Send

impl<'a, S> Sync for HttpRequestParser<'a, S> where
    S: Sync

impl<'a, S> Unpin for HttpRequestParser<'a, S> where
    S: Unpin

impl<'a, S> UnwindSafe for HttpRequestParser<'a, S> where
    S: UnwindSafe

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, 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.