Struct http_box::http2::Parser
[−]
[src]
pub struct Parser<'a, T: 'a + HttpHandler> { /* fields omitted */ }
HTTP 2.x parser.
Methods
impl<'a, T: 'a + HttpHandler> Parser<'a, T>[src]
fn new() -> Parser<'a, T>
Create a new Parser.
fn byte_count(&self) -> usize
Retrieve the total byte count processed since the instantiation of Parser.
The byte count is updated when resume() completes. This means that if a
call to byte_count() is executed from within a callback, it will be accurate within
stream.len() bytes. For precise accuracy, the best time to retrieve the byte count is
outside of all callbacks.
fn reset(&mut self)
Reset Parser to its initial state.
fn resume(
&mut self,
handler: &mut T,
stream: &[u8]
) -> Result<Success, ParserError>
&mut self,
handler: &mut T,
stream: &[u8]
) -> Result<Success, ParserError>
Resume parsing an additional slice of data.
Arguments
handler
The handler implementation.
stream
The stream of data to be parsed.
fn state(&self) -> ParserState
Retrieve the current state.