Trait DecisionModel
pub trait DecisionModel: Send + Sync {
// Required methods
fn id(&self) -> &str;
fn ask<'life0, 'async_trait>(
&'life0 self,
state: Value,
questions: BTreeMap<String, Question>,
) -> Pin<Box<dyn Future<Output = Result<Answers, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
}Expand description
Seam for the decision call. The daemon injects SystemOneClient; tests
inject a scripted model.
Required Methods§
fn ask<'life0, 'async_trait>(
&'life0 self,
state: Value,
questions: BTreeMap<String, Question>,
) -> Pin<Box<dyn Future<Output = Result<Answers, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".