Struct stream_httparse::streaming_parser::ReqParser [−][src]
pub struct ReqParser { /* fields omitted */ }
Expand description
A single Instance of the RequestParser that is used to parse HTTP-Requests
Implementations
impl ReqParser
[src]
impl ReqParser
[src]pub fn new_capacity(cap: usize) -> Self
[src]
pub fn new_capacity(cap: usize) -> Self
[src]Creates a new Request-Parser with the given capacity as its pre-reserved capacity to store the Head of the Request
pub fn clear(&mut self)
[src]
pub fn clear(&mut self)
[src]Clears the internal Buffers and resets everything to be ready to receive and parse a new request
This should be the prefered way to parse mulitple sequential requests, as this avoids extra allocations
pub fn block_parse(&mut self, bytes: &[u8]) -> (bool, Option<usize>)
[src]
pub fn block_parse(&mut self, bytes: &[u8]) -> (bool, Option<usize>)
[src]Returns a touple that stands for (done, data-left-in-buffer)
Explanation:
done
: True if the request has been fully received and parseddata-left-in-buffer
: The Amount of bytes at the end of the given slice that were unused
pub fn finish<'a, 'b>(&'a self) -> ParseResult<Request<'b>> where
'a: 'b,
[src]
pub fn finish<'a, 'b>(&'a self) -> ParseResult<Request<'b>> where
'a: 'b,
[src]Finishes up the parsing and finalizes all the Data it received and returns a Request-Instance containing the parsed out Request