Trait http_muncher::ParserHandler [] [src]

pub trait ParserHandler: Sized {
    fn on_url(&mut self, &mut Parser, &[u8]) -> bool { ... }
fn on_status(&mut self, &mut Parser, &[u8]) -> bool { ... }
fn on_header_field(&mut self, &mut Parser, &[u8]) -> bool { ... }
fn on_header_value(&mut self, &mut Parser, &[u8]) -> bool { ... }
fn on_body(&mut self, &mut Parser, &[u8]) -> bool { ... }
fn on_headers_complete(&mut self, &mut Parser) -> bool { ... }
fn on_message_begin(&mut self, &mut Parser) -> bool { ... }
fn on_message_complete(&mut self, &mut Parser) -> bool { ... }
fn on_chunk_header(&mut self, &mut Parser) -> bool { ... }
fn on_chunk_complete(&mut self, &mut Parser) -> bool { ... } }

Used to define a set of callbacks in your code. They would be called by the parser whenever new data is available. You should bear in mind that the data might get in your callbacks in a partial form.

Return bool as a result of each function call - either true for the "OK, go on" status, or false when you want to stop the parser after the function call has ended.

All callbacks provide a default no-op implementation (i.e. they just return true).

Provided Methods

Called when the URL part of a request becomes available. E.g. for GET /forty-two HTTP/1.1 it will be called with "/forty_two" argument.

It's not called in the response mode.

Called when a response status becomes available.

It's not called in the request mode.

Called for each HTTP header key part.

Called for each HTTP header value part.

Called with body text as an argument when the new part becomes available.

Notified when all available headers have been processed.

Notified when the parser receives first bytes to parse.

Notified when the parser has finished its job.

Implementors