Skip to main content

GatewayMiddleware

Trait GatewayMiddleware 

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

Source

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".

Implementors§