pingora_core::modules::http

Trait HttpModule

Source
pub trait HttpModule {
    // Required methods
    fn as_any(&self) -> &dyn Any;
    fn as_any_mut(&mut self) -> &mut dyn Any;

    // Provided methods
    fn request_header_filter<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        _req: &'life1 mut RequestHeader,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: Send + 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn request_body_filter<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        _body: &'life1 mut Option<Bytes>,
        _end_of_stream: bool,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: Send + 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn response_header_filter<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        _resp: &'life1 mut ResponseHeader,
        _end_of_stream: bool,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: Send + 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn response_body_filter(
        &mut self,
        _body: &mut Option<Bytes>,
        _end_of_stream: bool,
    ) -> Result<()> { ... }
    fn response_trailer_filter(
        &mut self,
        _trailers: &mut Option<Box<HeaderMap>>,
    ) -> Result<Option<Bytes>> { ... }
}
Expand description

The trait an HTTP traffic module needs to implement

Required Methods§

Source

fn as_any(&self) -> &dyn Any

Source

fn as_any_mut(&mut self) -> &mut dyn Any

Provided Methods§

Source

fn request_header_filter<'life0, 'life1, 'async_trait>( &'life0 mut self, _req: &'life1 mut RequestHeader, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: Send + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn request_body_filter<'life0, 'life1, 'async_trait>( &'life0 mut self, _body: &'life1 mut Option<Bytes>, _end_of_stream: bool, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: Send + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn response_header_filter<'life0, 'life1, 'async_trait>( &'life0 mut self, _resp: &'life1 mut ResponseHeader, _end_of_stream: bool, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: Send + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn response_body_filter( &mut self, _body: &mut Option<Bytes>, _end_of_stream: bool, ) -> Result<()>

Source

fn response_trailer_filter( &mut self, _trailers: &mut Option<Box<HeaderMap>>, ) -> Result<Option<Bytes>>

Implementors§