Trait Filter

Source
pub trait Filter:
    Debug
    + Send
    + Sync {
    // Required methods
    fn filter_type(&self) -> FilterType;
    fn name(&self) -> &str;

    // Provided methods
    fn pre_filter<'life0, 'async_trait>(
        &'life0 self,
        request: ProxyRequest,
    ) -> Pin<Box<dyn Future<Output = Result<ProxyRequest, ProxyError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn post_filter<'life0, 'async_trait>(
        &'life0 self,
        _request: ProxyRequest,
        response: ProxyResponse,
    ) -> Pin<Box<dyn Future<Output = Result<ProxyResponse, ProxyError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
}
Expand description

A filter that processes requests and responses.

Required Methods§

Source

fn filter_type(&self) -> FilterType

Get the filter type.

Source

fn name(&self) -> &str

Get the filter name.

Provided Methods§

Source

fn pre_filter<'life0, 'async_trait>( &'life0 self, request: ProxyRequest, ) -> Pin<Box<dyn Future<Output = Result<ProxyRequest, ProxyError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Process a request before it is sent to the target.

Source

fn post_filter<'life0, 'async_trait>( &'life0 self, _request: ProxyRequest, response: ProxyResponse, ) -> Pin<Box<dyn Future<Output = Result<ProxyResponse, ProxyError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Process a response after it is received from the target.

Implementors§