HttpProcessor

Trait HttpProcessor 

Source
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§

Source

fn can_process_request(&self, data: &[u8]) -> bool

Check if this processor can handle the given request data

Source

fn can_process_response(&self, data: &[u8]) -> bool

Check if this processor can handle the given response data

Source

fn has_complete_data(&self, data: &[u8]) -> bool

Check if the data appears to be complete for this protocol

Source

fn process_request( &self, data: &[u8], ) -> Result<Option<ObservableHttpRequest>, HuginnNetError>

Process HTTP request data and return observable request

Source

fn process_response( &self, data: &[u8], ) -> Result<Option<ObservableHttpResponse>, HuginnNetError>

Process HTTP response data and return observable response

Source

fn supported_version(&self) -> Version

Get the HTTP version this processor handles

Source

fn name(&self) -> &'static str

Get a human-readable name for this processor

Implementors§