pub trait HttpHandler {
Show 13 methods
// Provided methods
fn on_data(&mut self, data: &[u8], finished: bool) -> bool { ... }
fn on_frame_format(
&mut self,
payload_length: u32,
frame_type: u8,
flags: u8,
stream_id: u32,
) -> bool { ... }
fn on_go_away(&mut self, stream_id: u32, error_code: u32) -> bool { ... }
fn on_go_away_debug_data(&mut self, data: &[u8], finished: bool) -> bool { ... }
fn on_headers(
&mut self,
exclusive: bool,
stream_id: u32,
weight: u8,
) -> bool { ... }
fn on_headers_fragment(&mut self, fragment: &[u8], finished: bool) -> bool { ... }
fn on_ping(&mut self, data: &[u8], finished: bool) -> bool { ... }
fn on_priority(
&mut self,
exclusive: bool,
stream_id: u32,
weight: u8,
) -> bool { ... }
fn on_push_promise(&mut self, stream_id: u32) -> bool { ... }
fn on_rst_stream(&mut self, error_code: u32) -> bool { ... }
fn on_settings(&mut self, id: u16, value: u32) -> bool { ... }
fn on_unsupported(&mut self, data: &[u8], finished: bool) -> bool { ... }
fn on_window_update(&mut self, size_increment: u32) -> bool { ... }
}Expand description
Type that handles HTTP/2.x parser events.
Provided Methods§
Sourcefn on_data(&mut self, data: &[u8], finished: bool) -> bool
fn on_data(&mut self, data: &[u8], finished: bool) -> bool
Callback that is executed when a data frame has been located.
Note: This may be executed multiple times in order to supply the entire segment.
Arguments:
data
The data.
finished
Indicates this is the last chunk of the data.
Returns:
true when parsing should continue, false to exit the parser function prematurely with
Success::Callback.
Sourcefn on_frame_format(
&mut self,
payload_length: u32,
frame_type: u8,
flags: u8,
stream_id: u32,
) -> bool
fn on_frame_format( &mut self, payload_length: u32, frame_type: u8, flags: u8, stream_id: u32, ) -> bool
Callback that is executed when a new frame format has been located.
Arguments:
payload_length
The payload length.
frame_type
The type.
flags
The flags.
stream_id
The stream identifier.
Returns:
true when parsing should continue, false to exit the parser function prematurely with
Success::Callback.
Sourcefn on_go_away(&mut self, stream_id: u32, error_code: u32) -> bool
fn on_go_away(&mut self, stream_id: u32, error_code: u32) -> bool
Callback that is executed when a go away frame has been located.
Arguments:
stream_id
The stream identifier.
error_code
The error code.
Returns:
true when parsing should continue, false to exit the parser function prematurely with
Success::Callback.
Sourcefn on_go_away_debug_data(&mut self, data: &[u8], finished: bool) -> bool
fn on_go_away_debug_data(&mut self, data: &[u8], finished: bool) -> bool
Callback that is executed when go away frame debug data has been located.
Note: This may be executed multiple times in order to supply the entire segment.
Arguments:
data
The data.
finished
Indicates this is the last chunk of the data.
Returns:
true when parsing should continue, false to exit the parser function prematurely with
Success::Callback.
Sourcefn on_headers(&mut self, exclusive: bool, stream_id: u32, weight: u8) -> bool
fn on_headers(&mut self, exclusive: bool, stream_id: u32, weight: u8) -> bool
Callback that is executed when a headers frame has been located.
Arguments:
exclusive
Indicates the stream identifier is exclusive.
stream_id
The stream identifier.
weight
The weight.
Returns:
true when parsing should continue, false to exit the parser function prematurely with
Success::Callback.
Sourcefn on_headers_fragment(&mut self, fragment: &[u8], finished: bool) -> bool
fn on_headers_fragment(&mut self, fragment: &[u8], finished: bool) -> bool
Callback that is executed when a headers frame fragment has been located.
Note: This may be executed multiple times in order to supply the entire segment.
Arguments:
fragment
The fragment.
finished
Indicates this is the last chunk of the fragment.
Returns:
true when parsing should continue, false to exit the parser function prematurely with
Success::Callback.
Sourcefn on_ping(&mut self, data: &[u8], finished: bool) -> bool
fn on_ping(&mut self, data: &[u8], finished: bool) -> bool
Callback that is executed when a ping frame has been located.
Note: This may be executed multiple times in order to supply the entire segment.
Arguments:
data
The data.
finished
Indicates this is the last chunk of the data.
Returns:
true when parsing should continue, false to exit the parser function prematurely with
Success::Callback.
Sourcefn on_priority(&mut self, exclusive: bool, stream_id: u32, weight: u8) -> bool
fn on_priority(&mut self, exclusive: bool, stream_id: u32, weight: u8) -> bool
Callback that is executed when a priority frame has been located.
Arguments:
exclusive
Indicates the stream identifier is exclusive.
stream_id
The stream identifier.
weight
The weight.
Returns:
true when parsing should continue, false to exit the parser function prematurely with
Success::Callback.
Sourcefn on_push_promise(&mut self, stream_id: u32) -> bool
fn on_push_promise(&mut self, stream_id: u32) -> bool
Callback that is executed when a push promise frame has been located.
Arguments:
stream_id
The stream identifier.
Returns:
true when parsing should continue, false to exit the parser function prematurely with
Success::Callback.
Sourcefn on_rst_stream(&mut self, error_code: u32) -> bool
fn on_rst_stream(&mut self, error_code: u32) -> bool
Callback that is executed when a rst stream frame has been located.
Arguments:
error_code
The error code.
Returns:
true when parsing should continue, false to exit the parser function prematurely with
Success::Callback.
Sourcefn on_settings(&mut self, id: u16, value: u32) -> bool
fn on_settings(&mut self, id: u16, value: u32) -> bool
Callback that is executed when a settings frame has been located.
Arguments:
id
The identifier.
value
The value.
Returns:
true when parsing should continue, false to exit the parser function prematurely with
Success::Callback.
Sourcefn on_unsupported(&mut self, data: &[u8], finished: bool) -> bool
fn on_unsupported(&mut self, data: &[u8], finished: bool) -> bool
Callback that is executed when an unsupported frame has been located.
Note: This may be executed multiple times in order to supply the entire segment.
Arguments:
data
The data.
finished
Indicates this is the last chunk of the data.
Returns:
true when parsing should continue, false to exit the parser function prematurely with
Success::Callback.
Sourcefn on_window_update(&mut self, size_increment: u32) -> bool
fn on_window_update(&mut self, size_increment: u32) -> bool
Callback that is executed when a window update frame has been located.
Arguments:
size_increment
The size increment.
Returns:
true when parsing should continue, false to exit the parser function prematurely with
Success::Callback.