pub trait GatewayMiddleware: Send + Sync {
// Required method
fn handle<'a>(
&'a self,
request: DelegationRequest,
next: GatewayNext<'a>,
) -> GatewayFuture<'a, Result<AgentOutcome, GatewayError>>;
}Expand description
Object-safe around-middleware for agent delegation.
Implementations may inspect or transform input, reject an invocation,
observe the result, or call next more than once for explicit retries.
Every call to next still passes through the protected terminal authority,
lifecycle, depth, and budget checks.
Required Methods§
Sourcefn handle<'a>(
&'a self,
request: DelegationRequest,
next: GatewayNext<'a>,
) -> GatewayFuture<'a, Result<AgentOutcome, GatewayError>>
fn handle<'a>( &'a self, request: DelegationRequest, next: GatewayNext<'a>, ) -> GatewayFuture<'a, Result<AgentOutcome, GatewayError>>
Handles one delegation invocation.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".