pub trait CandidateGate {
type Query;
type Result;
type Error;
// Required method
fn execute_with_gate(
&self,
query: &Self::Query,
allowed_set: &AllowedSet,
) -> Result<Self::Result, Self::Error>;
// Provided method
fn strategy_for_selectivity(&self, selectivity: f64) -> ExecutionStrategy { ... }
}Expand description
The candidate gate trait that all executors must implement
This trait ensures every retrieval path respects the AllowedSet.
Required Associated Types§
Required Methods§
Sourcefn execute_with_gate(
&self,
query: &Self::Query,
allowed_set: &AllowedSet,
) -> Result<Self::Result, Self::Error>
fn execute_with_gate( &self, query: &Self::Query, allowed_set: &AllowedSet, ) -> Result<Self::Result, Self::Error>
Execute with a mandatory allowed set
§Contract
- MUST NOT return any result with doc_id not in allowed_set
- SHOULD short-circuit if allowed_set is empty
- SHOULD use selectivity to choose execution strategy
Provided Methods§
Sourcefn strategy_for_selectivity(&self, selectivity: f64) -> ExecutionStrategy
fn strategy_for_selectivity(&self, selectivity: f64) -> ExecutionStrategy
Get the execution strategy for a given selectivity