pub trait DecisionEngine: Send + Sync {
// Required methods
fn name(&self) -> &str;
fn state(&self) -> DecisionState;
fn start<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = DecisionResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn stop<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = DecisionResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn make_decisions<'life0, 'life1, 'async_trait>(
&'life0 mut self,
input: DecisionInput,
criteria: &'life1 DecisionCriteria,
) -> Pin<Box<dyn Future<Output = DecisionResult<Vec<Decision>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn record_outcome<'life0, 'async_trait>(
&'life0 mut self,
outcome: DecisionOutcome,
) -> Pin<Box<dyn Future<Output = DecisionResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_stats(&self) -> DecisionStats;
fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = DecisionResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn reset<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = DecisionResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Core trait for the Decision Engine
Required Methods§
Sourcefn state(&self) -> DecisionState
fn state(&self) -> DecisionState
Get the current state
Sourcefn start<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = DecisionResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn start<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = DecisionResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Start the decision engine
Sourcefn stop<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = DecisionResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn stop<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = DecisionResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Stop the decision engine
Sourcefn make_decisions<'life0, 'life1, 'async_trait>(
&'life0 mut self,
input: DecisionInput,
criteria: &'life1 DecisionCriteria,
) -> Pin<Box<dyn Future<Output = DecisionResult<Vec<Decision>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn make_decisions<'life0, 'life1, 'async_trait>(
&'life0 mut self,
input: DecisionInput,
criteria: &'life1 DecisionCriteria,
) -> Pin<Box<dyn Future<Output = DecisionResult<Vec<Decision>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Sourcefn record_outcome<'life0, 'async_trait>(
&'life0 mut self,
outcome: DecisionOutcome,
) -> Pin<Box<dyn Future<Output = DecisionResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn record_outcome<'life0, 'async_trait>(
&'life0 mut self,
outcome: DecisionOutcome,
) -> Pin<Box<dyn Future<Output = DecisionResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Record the outcome of a decision
Sourcefn get_stats(&self) -> DecisionStats
fn get_stats(&self) -> DecisionStats
Get decision statistics
Sourcefn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = DecisionResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = DecisionResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Health check