pub trait RoutingEngine: Send + Sync {
// Required methods
fn route_request<'life0, 'life1, 'async_trait>(
&'life0 self,
context: &'life1 RoutingContext,
) -> Pin<Box<dyn Future<Output = Result<RouteDecision, RoutingError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn execute_with_routing<'life0, 'async_trait>(
&'life0 self,
context: RoutingContext,
request: ModelRequest,
) -> Pin<Box<dyn Future<Output = Result<ModelResponse, RoutingError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn validate_policies(&self) -> Result<(), RoutingError>;
fn get_routing_stats<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = RoutingStatistics> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn update_config<'life0, 'async_trait>(
&'life0 self,
config: RoutingConfig,
) -> Pin<Box<dyn Future<Output = Result<(), RoutingError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Core routing engine trait for SLM-first architecture
Required Methods§
Sourcefn route_request<'life0, 'life1, 'async_trait>(
&'life0 self,
context: &'life1 RoutingContext,
) -> Pin<Box<dyn Future<Output = Result<RouteDecision, RoutingError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn route_request<'life0, 'life1, 'async_trait>(
&'life0 self,
context: &'life1 RoutingContext,
) -> Pin<Box<dyn Future<Output = Result<RouteDecision, RoutingError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Route a model request based on configured policies
Sourcefn execute_with_routing<'life0, 'async_trait>(
&'life0 self,
context: RoutingContext,
request: ModelRequest,
) -> Pin<Box<dyn Future<Output = Result<ModelResponse, RoutingError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn execute_with_routing<'life0, 'async_trait>(
&'life0 self,
context: RoutingContext,
request: ModelRequest,
) -> Pin<Box<dyn Future<Output = Result<ModelResponse, RoutingError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Execute the routing decision and handle fallbacks
Sourcefn validate_policies(&self) -> Result<(), RoutingError>
fn validate_policies(&self) -> Result<(), RoutingError>
Validate routing policies
Sourcefn get_routing_stats<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = RoutingStatistics> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_routing_stats<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = RoutingStatistics> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get routing statistics
Sourcefn update_config<'life0, 'async_trait>(
&'life0 self,
config: RoutingConfig,
) -> Pin<Box<dyn Future<Output = Result<(), RoutingError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn update_config<'life0, 'async_trait>(
&'life0 self,
config: RoutingConfig,
) -> Pin<Box<dyn Future<Output = Result<(), RoutingError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Update routing configuration