pub trait HttpProcessor {
// Required methods
fn can_process_request(&self, data: &[u8]) -> bool;
fn can_process_response(&self, data: &[u8]) -> bool;
fn has_complete_data(&self, data: &[u8]) -> bool;
fn process_request(
&self,
data: &[u8],
) -> Result<Option<ObservableHttpRequest>, HuginnNetError>;
fn process_response(
&self,
data: &[u8],
) -> Result<Option<ObservableHttpResponse>, HuginnNetError>;
fn supported_version(&self) -> Version;
fn name(&self) -> &'static str;
}
Expand description
Common trait for HTTP protocol processors
Required Methods§
Sourcefn can_process_request(&self, data: &[u8]) -> bool
fn can_process_request(&self, data: &[u8]) -> bool
Check if this processor can handle the given request data
Sourcefn can_process_response(&self, data: &[u8]) -> bool
fn can_process_response(&self, data: &[u8]) -> bool
Check if this processor can handle the given response data
Sourcefn has_complete_data(&self, data: &[u8]) -> bool
fn has_complete_data(&self, data: &[u8]) -> bool
Check if the data appears to be complete for this protocol
Sourcefn process_request(
&self,
data: &[u8],
) -> Result<Option<ObservableHttpRequest>, HuginnNetError>
fn process_request( &self, data: &[u8], ) -> Result<Option<ObservableHttpRequest>, HuginnNetError>
Process HTTP request data and return observable request
Sourcefn process_response(
&self,
data: &[u8],
) -> Result<Option<ObservableHttpResponse>, HuginnNetError>
fn process_response( &self, data: &[u8], ) -> Result<Option<ObservableHttpResponse>, HuginnNetError>
Process HTTP response data and return observable response
Sourcefn supported_version(&self) -> Version
fn supported_version(&self) -> Version
Get the HTTP version this processor handles