pub trait RiskSimulationEngine: Send + Sync {
// Required methods
fn set_simulated_risk<'life0, 'async_trait>(
&'life0 self,
user_id: String,
score: Option<f64>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn set_simulated_factors<'life0, 'async_trait>(
&'life0 self,
user_id: String,
factors: HashMap<String, f64>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn clear_simulated_risk<'life0, 'life1, 'async_trait>(
&'life0 self,
user_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn assess_risk<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
user_id: &'life1 str,
factors: &'life2 HashMap<String, f64>,
) -> Pin<Box<dyn Future<Output = RiskAssessment> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
}Expand description
Risk-engine operations used by the simulation routes.
Required Methods§
Sourcefn set_simulated_risk<'life0, 'async_trait>(
&'life0 self,
user_id: String,
score: Option<f64>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn set_simulated_risk<'life0, 'async_trait>(
&'life0 self,
user_id: String,
score: Option<f64>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Set or remove the existing score override.
Sourcefn set_simulated_factors<'life0, 'async_trait>(
&'life0 self,
user_id: String,
factors: HashMap<String, f64>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn set_simulated_factors<'life0, 'async_trait>(
&'life0 self,
user_id: String,
factors: HashMap<String, f64>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Set the existing per-user factor overrides.
Sourcefn clear_simulated_risk<'life0, 'life1, 'async_trait>(
&'life0 self,
user_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn clear_simulated_risk<'life0, 'life1, 'async_trait>(
&'life0 self,
user_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Clear score and factor overrides for one user.
Sourcefn assess_risk<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
user_id: &'life1 str,
factors: &'life2 HashMap<String, f64>,
) -> Pin<Box<dyn Future<Output = RiskAssessment> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn assess_risk<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
user_id: &'life1 str,
factors: &'life2 HashMap<String, f64>,
) -> Pin<Box<dyn Future<Output = RiskAssessment> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Assess risk using the application’s current configuration and overrides.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".