pub trait Gate:
Send
+ Sync
+ Debug {
// Required methods
fn id(&self) -> &str;
fn evaluate<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
req: &'life1 ModelRequest,
resp: &'life2 ModelResponse,
) -> Pin<Box<dyn Future<Output = GateResult> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
}Expand description
A verification gate. Object-safe + async so subprocess/model gates fit the same contract.
Required Methods§
Sourcefn evaluate<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
req: &'life1 ModelRequest,
resp: &'life2 ModelResponse,
) -> Pin<Box<dyn Future<Output = GateResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn evaluate<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
req: &'life1 ModelRequest,
resp: &'life2 ModelResponse,
) -> Pin<Box<dyn Future<Output = GateResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Evaluate the candidate response, producing a verdict + evidence.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".