pub struct ResponseParser { /* private fields */ }Expand description
Incremental HTTP response parser.
Feed bytes via feed(). When state() returns ParseState::Complete,
call take_response() to extract the finished HttpResponse.
Implementations§
Source§impl ResponseParser
impl ResponseParser
Sourcepub fn state(&self) -> &ParseState
pub fn state(&self) -> &ParseState
Return the current parse state.
Sourcepub fn feed(&mut self, data: &[u8]) -> Result<(), HttpError>
pub fn feed(&mut self, data: &[u8]) -> Result<(), HttpError>
Feed bytes into the parser, advancing the state machine.
Sourcepub fn take_response(&mut self) -> Option<HttpResponse>
pub fn take_response(&mut self) -> Option<HttpResponse>
Extract the completed response. Returns None if parsing is not
complete.