ResponseMiddleware

Trait ResponseMiddleware 

Source
pub trait ResponseMiddleware:
    Send
    + Sync
    + Debug {
    // Required methods
    fn process_response<'life0, 'life1, 'async_trait>(
        &'life0 self,
        context: &'life1 mut ResponseContext,
    ) -> Pin<Box<dyn Future<Output = MiddlewareResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn name(&self) -> &str;
}
Expand description

Trait for response middleware

Response middleware process responses after they’re received from the server. They are executed in the order they are registered.

Required Methods§

Source

fn process_response<'life0, 'life1, 'async_trait>( &'life0 self, context: &'life1 mut ResponseContext, ) -> Pin<Box<dyn Future<Output = MiddlewareResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Process the response context

§Arguments
  • context - Mutable response context that can be modified
§Returns

Returns Ok(()) if processing succeeds, or PluginError if it fails.

Source

fn name(&self) -> &str

Get middleware name for debugging

Implementors§