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]

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]

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]

Returns a touple that stands for (done, data-left-in-buffer)

Explanation:

  • done: True if the request has been fully received and parsed
  • data-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]

Finishes up the parsing and finalizes all the Data it received and returns a Request-Instance containing the parsed out Request

Auto Trait Implementations

Blanket Implementations

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

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.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.