DMSCMiddleware

Trait DMSCMiddleware 

Source
pub trait DMSCMiddleware: Send + Sync {
    // Required methods
    fn execute<'life0, 'life1, 'async_trait>(
        &'life0 self,
        request: &'life1 mut DMSCGatewayRequest,
    ) -> Pin<Box<dyn Future<Output = DMSCResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn name(&self) -> &'static str;
}
Expand description

Trait defining the middleware interface for request processing.

All middleware components must implement this trait, which provides methods for executing middleware logic and identifying the middleware.

Required Methods§

Source

fn execute<'life0, 'life1, 'async_trait>( &'life0 self, request: &'life1 mut DMSCGatewayRequest, ) -> Pin<Box<dyn Future<Output = DMSCResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Executes the middleware logic on a request.

This method is called for each request passing through the middleware chain. Middleware can modify the request, validate it, or return an error to abort processing.

§Parameters
  • request: Mutable reference to the request being processed
§Returns

A DMSCResult<()> indicating success or failure

Source

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

Gets the name of the middleware.

This method returns a static string identifier for the middleware, useful for logging and debugging purposes.

§Returns

A static string containing the middleware name

Implementors§