pub trait HttpParser {
// Required methods
fn supported_version(&self) -> Version;
fn can_parse(&self, data: &[u8]) -> bool;
fn name(&self) -> &'static str;
fn parse_request(&self, data: &[u8]) -> Option<ObservableHttpRequest>;
fn parse_response(&self, data: &[u8]) -> Option<ObservableHttpResponse>;
}
Expand description
Common trait for all HTTP parsers across different versions
Required Methods§
Sourcefn supported_version(&self) -> Version
fn supported_version(&self) -> Version
Get the HTTP version this parser supports
Sourcefn parse_request(&self, data: &[u8]) -> Option<ObservableHttpRequest>
fn parse_request(&self, data: &[u8]) -> Option<ObservableHttpRequest>
Parse HTTP request data into observable signals Returns None if data cannot be parsed by this parser
Sourcefn parse_response(&self, data: &[u8]) -> Option<ObservableHttpResponse>
fn parse_response(&self, data: &[u8]) -> Option<ObservableHttpResponse>
Parse HTTP response data into observable signals
Returns None if data cannot be parsed by this parser