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;
// Provided method
fn abstain_fails_closed(&self) -> bool { ... }
}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.
Provided Methods§
Sourcefn abstain_fails_closed(&self) -> bool
fn abstain_fails_closed(&self) -> bool
Whether an abstain from this gate blocks serving like a Fail (§7.2,
on_abstain = "fail_closed"). Default false = fail-open, the historical behavior.
The abstain verdict itself is still recorded honestly on the receipt; only the
aggregation treats it as blocking.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".