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§
Sourcefn route(&self, plan: &ExecutionPlan) -> RoutingDecision
fn route(&self, plan: &ExecutionPlan) -> RoutingDecision
Decide which backend route to take for a given plan.
Provided Methods§
Sourcefn route_with_explanation(&self, plan: &ExecutionPlan) -> RoutingExplanation
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".