pub struct Parser<'a, T: HttpHandler + 'a> { /* private fields */ }Expand description
HTTP 2.x parser.
Implementations§
Source§impl<'a, T: HttpHandler + 'a> Parser<'a, T>
impl<'a, T: HttpHandler + 'a> Parser<'a, T>
Sourcepub fn byte_count(&self) -> usize
pub 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.
Sourcepub fn resume(
&mut self,
handler: &mut T,
stream: &[u8],
) -> Result<Success, ParserError>
pub fn resume( &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.
Sourcepub fn state(&self) -> ParserState
pub fn state(&self) -> ParserState
Retrieve the current state.
Auto Trait Implementations§
impl<'a, T> Freeze for Parser<'a, T>
impl<'a, T> RefUnwindSafe for Parser<'a, T>
impl<'a, T> Send for Parser<'a, T>
impl<'a, T> Sync for Parser<'a, T>
impl<'a, T> Unpin for Parser<'a, T>
impl<'a, T> UnwindSafe for Parser<'a, T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more