Skip to main content

RoutingPolicy

Trait RoutingPolicy 

Source
pub trait RoutingPolicy: Send + Sync {
    // Required methods
    fn name(&self) -> &'static str;
    fn route(&self, plan: &ExecutionPlan) -> RoutingDecision;

    // Provided method
    fn route_with_explanation(&self, plan: &ExecutionPlan) -> RoutingExplanation { ... }
}
Expand description

Pluggable routing policy.

Required Methods§

Source

fn name(&self) -> &'static str

Name of the policy for diagnostics.

Source

fn route(&self, plan: &ExecutionPlan) -> RoutingDecision

Decide which backend route to take for a given plan.

Provided Methods§

Source

fn route_with_explanation(&self, plan: &ExecutionPlan) -> RoutingExplanation

Decide which backend route to take and explain the decision.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§