pub trait RoutingFunction: Send + Sync {
// Required method
fn route<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
state: &'life1 AgentState,
config: &'life2 GraphConfig,
) -> Pin<Box<dyn Future<Output = Result<RouterOutput>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
// Provided method
fn semantic_digest(&self) -> String { ... }
}Expand description
Determines which node to visit next based on current state.
Required Methods§
Sourcefn route<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
state: &'life1 AgentState,
config: &'life2 GraphConfig,
) -> Pin<Box<dyn Future<Output = Result<RouterOutput>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn route<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
state: &'life1 AgentState,
config: &'life2 GraphConfig,
) -> Pin<Box<dyn Future<Output = Result<RouterOutput>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Returns routing decision.
Return RouterOutput::Next(None) to end execution.
Provided Methods§
Sourcefn semantic_digest(&self) -> String
fn semantic_digest(&self) -> String
Stable caller-visible identity for routing semantics. Implementations should override this when the route behavior depends on configuration.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".