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§
Sourcefn 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 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