Skip to main content

RoutingPort

Trait RoutingPort 

Source
pub trait RoutingPort: Send + Sync {
    // Required method
    fn route_decision<'life0, 'life1, 'async_trait>(
        &'life0 self,
        task: &'life1 Task,
    ) -> Pin<Box<dyn Future<Output = Result<RoutingDecision>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;

    // Provided method
    fn route<'life0, 'life1, 'async_trait>(
        &'life0 self,
        task: &'life1 Task,
    ) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
}
Expand description

Selects an engine/agent target for a task.

Adapters may delegate to crate::routing_port::RoutingSuperset for load-balancing strategies, per-target circuit breakers, and weighted fallback.

Required Methods§

Source

fn route_decision<'life0, 'life1, 'async_trait>( &'life0 self, task: &'life1 Task, ) -> Pin<Box<dyn Future<Output = Result<RoutingDecision>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Return a full RoutingDecision (engine + model + rationale).

Phase 1 introduces the structured decision so adapters (e.g. the routing-phenotype-router adapter) can route to a specific model/provider while preserving the engine target.

Provided Methods§

Source

fn route<'life0, 'life1, 'async_trait>( &'life0 self, task: &'life1 Task, ) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Return the engine name that should handle task.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§