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§
Sourcefn filter_type(&self) -> FilterType
fn filter_type(&self) -> FilterType
Get the filter type.
Provided Methods§
Sourcefn 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 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.
Sourcefn 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,
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.