pub trait HttpHandler {
Show 23 methods
// Provided methods
fn content_length(&mut self) -> Option<usize> { ... }
fn on_body_finished(&mut self) -> bool { ... }
fn on_chunk_begin(&mut self) -> bool { ... }
fn on_chunk_data(&mut self, data: &[u8]) -> bool { ... }
fn on_chunk_extension_finished(&mut self) -> bool { ... }
fn on_chunk_extension_name(&mut self, name: &[u8]) -> bool { ... }
fn on_chunk_extension_value(&mut self, value: &[u8]) -> bool { ... }
fn on_chunk_extensions_finished(&mut self) -> bool { ... }
fn on_chunk_length(&mut self, size: usize) -> bool { ... }
fn on_header_name(&mut self, name: &[u8]) -> bool { ... }
fn on_header_value(&mut self, value: &[u8]) -> bool { ... }
fn on_headers_finished(&mut self) -> bool { ... }
fn on_initial_finished(&mut self) -> bool { ... }
fn on_method(&mut self, method: &[u8]) -> bool { ... }
fn on_multipart_begin(&mut self) -> bool { ... }
fn on_multipart_data(&mut self, data: &[u8]) -> bool { ... }
fn on_status(&mut self, status: &[u8]) -> bool { ... }
fn on_status_code(&mut self, code: u16) -> bool { ... }
fn on_url(&mut self, url: &[u8]) -> bool { ... }
fn on_url_encoded_begin(&mut self) -> bool { ... }
fn on_url_encoded_name(&mut self, name: &[u8]) -> bool { ... }
fn on_url_encoded_value(&mut self, value: &[u8]) -> bool { ... }
fn on_version(&mut self, major: u16, minor: u16) -> bool { ... }
}Expand description
Type that handles HTTP/1.x parser events.
Provided Methods§
Sourcefn content_length(&mut self) -> Option<usize>
fn content_length(&mut self) -> Option<usize>
Retrieve the content length.
Called When::
Within multipart parsing, after each boundary’s head data has been parsed.
Sourcefn on_body_finished(&mut self) -> bool
fn on_body_finished(&mut self) -> bool
Callback that is executed when body parsing has completed successfully.
Returns:
true when parsing should continue, false to exit the parser function prematurely with
Success::Callback.
Sourcefn on_chunk_begin(&mut self) -> bool
fn on_chunk_begin(&mut self) -> bool
Callback that is executed when a new chunk section has been located. This is executed prior to the length, extensions, and data.
Returns:
true when parsing should continue, false to exit the parser function prematurely with
Success::Callback.
Sourcefn on_chunk_data(&mut self, data: &[u8]) -> bool
fn on_chunk_data(&mut self, data: &[u8]) -> bool
Callback that is executed when chunk encoded data has been located.
Note: This may be executed multiple times in order to supply the entire segment.
Returns:
true when parsing should continue, false to exit the parser function prematurely with
Success::Callback.
Sourcefn on_chunk_extension_finished(&mut self) -> bool
fn on_chunk_extension_finished(&mut self) -> bool
Callback that is executed when parsing an individual chunk extension name/value pair has completed successfully.
Returns:
true when parsing should continue, false to exit the parser function prematurely with
Success::Callback.
Sourcefn on_chunk_extension_name(&mut self, name: &[u8]) -> bool
fn on_chunk_extension_name(&mut self, name: &[u8]) -> bool
Callback that is executed when a chunk extension name has been located.
Note: This may be executed multiple times in order to supply the entire segment.
Returns:
true when parsing should continue, false to exit the parser function prematurely with
Success::Callback.
Sourcefn on_chunk_extension_value(&mut self, value: &[u8]) -> bool
fn on_chunk_extension_value(&mut self, value: &[u8]) -> bool
Callback that is executed when a chunk extension value has been located.
Note: This may be executed multiple times in order to supply the entire segment.
Returns:
true when parsing should continue, false to exit the parser function prematurely with
Success::Callback.
Sourcefn on_chunk_extensions_finished(&mut self) -> bool
fn on_chunk_extensions_finished(&mut self) -> bool
Callback that is executed when parsing all chunk extensions has completed successfully.
Returns:
true when parsing should continue, false to exit the parser function prematurely with
Success::Callback.
Sourcefn on_chunk_length(&mut self, size: usize) -> bool
fn on_chunk_length(&mut self, size: usize) -> bool
Callback that is executed when a chunk length has been located.
Returns:
true when parsing should continue, false to exit the parser function prematurely with
Success::Callback.
Sourcefn on_header_name(&mut self, name: &[u8]) -> bool
fn on_header_name(&mut self, name: &[u8]) -> bool
Callback that is executed when a header name has been located.
Note: This may be executed multiple times in order to supply the entire segment.
Returns:
true when parsing should continue, false to exit the parser function prematurely with
Success::Callback.
Called When:
During head parsing, multipart parsing of headers for each piece of data, or at the end of chunk encoded data when trailers are present.
Sourcefn on_header_value(&mut self, value: &[u8]) -> bool
fn on_header_value(&mut self, value: &[u8]) -> bool
Callback that is executed when a header value has been located.
Note: This may be executed multiple times in order to supply the entire segment.
Returns:
true when parsing should continue, false to exit the parser function prematurely with
Success::Callback.
Called When:
During head parsing, multipart parsing of headers for each piece of data, or at the end of chunk encoded data when trailers are present.
Sourcefn on_headers_finished(&mut self) -> bool
fn on_headers_finished(&mut self) -> bool
Callback that is executed when header parsing has completed successfully.
Returns:
true when parsing should continue, false to exit the parser function prematurely with
Success::Callback.
Called When:
During head parsing, multipart parsing of headers for each piece of data, or at the end of chunk encoded data when trailers are present.
Sourcefn on_initial_finished(&mut self) -> bool
fn on_initial_finished(&mut self) -> bool
Callback that is executed when parsing the initial request/response line has completed successfully.
Returns:
true when parsing should continue, false to exit the parser function prematurely with
Success::Callback.
Sourcefn on_method(&mut self, method: &[u8]) -> bool
fn on_method(&mut self, method: &[u8]) -> bool
Callback that is executed when a request method has been located.
Note: This may be executed multiple times in order to supply the entire segment.
Returns:
true when parsing should continue, false to exit the parser function prematurely with
Success::Callback.
Sourcefn on_multipart_begin(&mut self) -> bool
fn on_multipart_begin(&mut self) -> bool
Callback that is executed when a new multipart section has been located. This is executed prior to any headers.
Returns:
true when parsing should continue, false to exit the parser function prematurely with
Success::Callback.
Sourcefn on_multipart_data(&mut self, data: &[u8]) -> bool
fn on_multipart_data(&mut self, data: &[u8]) -> bool
Callback that is executed when multipart data has been located.
Note: This may be executed multiple times in order to supply the entire segment.
Returns:
true when parsing should continue, false to exit the parser function prematurely with
Success::Callback.
Sourcefn on_status(&mut self, status: &[u8]) -> bool
fn on_status(&mut self, status: &[u8]) -> bool
Callback that is executed when a response status has been located.
Note: This may be executed multiple times in order to supply the entire segment.
Returns:
true when parsing should continue, false to exit the parser function prematurely with
Success::Callback.
Sourcefn on_status_code(&mut self, code: u16) -> bool
fn on_status_code(&mut self, code: u16) -> bool
Callback that is executed when a response status code has been located.
Returns:
true when parsing should continue, false to exit the parser function prematurely with
Success::Callback.
Sourcefn on_url(&mut self, url: &[u8]) -> bool
fn on_url(&mut self, url: &[u8]) -> bool
Callback that is executed when a request URL has been located.
Note: This may be executed multiple times in order to supply the entire segment.
Returns:
true when parsing should continue, false to exit the parser function prematurely with
Success::Callback.
Sourcefn on_url_encoded_begin(&mut self) -> bool
fn on_url_encoded_begin(&mut self) -> bool
Callback that is executed when a new URL encoded name/value pair has been located.
Returns:
true when parsing should continue, false to exit the parser function prematurely with
Success::Callback.
Sourcefn on_url_encoded_name(&mut self, name: &[u8]) -> bool
fn on_url_encoded_name(&mut self, name: &[u8]) -> bool
Callback that is executed when a URL encoded name has been located.
Note: This may be executed multiple times in order to supply the entire segment.
Returns:
true when parsing should continue, false to exit the parser function prematurely with
Success::Callback.
Sourcefn on_url_encoded_value(&mut self, value: &[u8]) -> bool
fn on_url_encoded_value(&mut self, value: &[u8]) -> bool
Callback that is executed when a URL encoded value has been located.
Note: This may be executed multiple times in order to supply the entire segment.
Returns:
true when parsing should continue, false to exit the parser function prematurely with
Success::Callback.
Sourcefn on_version(&mut self, major: u16, minor: u16) -> bool
fn on_version(&mut self, major: u16, minor: u16) -> bool
Callback that is executed when the HTTP version has been located during the initial request or response line.
Returns:
true when parsing should continue, false to exit the parser function prematurely with
Success::Callback.