[][src]Trait http_parser::parser::Parse

pub trait Parse {
    type NextState;
    fn parse(self) -> Self::NextState;
}

The provides the means of state transition for the parser, it provides a single function parse, when called it is supposed to parse the stream until the completion of the current state.

Associated Types

type NextState

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.

Loading content...

Required methods

fn parse(self) -> Self::NextState

Parse the existing content consuming it in the process, in the end, return the next parser state.

Loading content...

Implementors

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.

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

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

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

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

Loading content...