Skip to main content

CandidateGate

Trait CandidateGate 

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

Source

type Query

The query type

Source

type Result

The result type

Source

type Error

The error type

Required Methods§

Source

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§

Source

fn strategy_for_selectivity(&self, selectivity: f64) -> ExecutionStrategy

Get the execution strategy for a given selectivity

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§