pub trait HypothesisStorage: Send + Sync {
// Required methods
fn create_hypothesis<'life0, 'life1, 'async_trait>(
&'life0 self,
hypothesis: &'life1 Hypothesis,
) -> Pin<Box<dyn Future<Output = Result<HypothesisId>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_hypothesis<'life0, 'async_trait>(
&'life0 self,
id: HypothesisId,
) -> Pin<Box<dyn Future<Output = Result<Option<Hypothesis>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn update_confidence<'life0, 'async_trait>(
&'life0 self,
id: HypothesisId,
posterior: Confidence,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn set_status<'life0, 'async_trait>(
&'life0 self,
id: HypothesisId,
status: HypothesisStatus,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn list_hypotheses<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<Hypothesis>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn delete_hypothesis<'life0, 'async_trait>(
&'life0 self,
id: HypothesisId,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn attach_evidence<'life0, 'life1, 'async_trait>(
&'life0 self,
evidence: &'life1 Evidence,
) -> Pin<Box<dyn Future<Output = Result<EvidenceId>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_evidence<'life0, 'async_trait>(
&'life0 self,
id: EvidenceId,
) -> Pin<Box<dyn Future<Output = Result<Option<Evidence>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn list_evidence_for_hypothesis<'life0, 'async_trait>(
&'life0 self,
hypothesis_id: HypothesisId,
) -> Pin<Box<dyn Future<Output = Result<Vec<Evidence>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn list_all_evidence<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<Evidence>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn delete_evidence<'life0, 'async_trait>(
&'life0 self,
id: EvidenceId,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Storage trait for hypotheses (allows test mocks)
Required Methods§
Sourcefn create_hypothesis<'life0, 'life1, 'async_trait>(
&'life0 self,
hypothesis: &'life1 Hypothesis,
) -> Pin<Box<dyn Future<Output = Result<HypothesisId>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn create_hypothesis<'life0, 'life1, 'async_trait>(
&'life0 self,
hypothesis: &'life1 Hypothesis,
) -> Pin<Box<dyn Future<Output = Result<HypothesisId>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Create a new hypothesis
Sourcefn get_hypothesis<'life0, 'async_trait>(
&'life0 self,
id: HypothesisId,
) -> Pin<Box<dyn Future<Output = Result<Option<Hypothesis>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_hypothesis<'life0, 'async_trait>(
&'life0 self,
id: HypothesisId,
) -> Pin<Box<dyn Future<Output = Result<Option<Hypothesis>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get a hypothesis by ID
Sourcefn update_confidence<'life0, 'async_trait>(
&'life0 self,
id: HypothesisId,
posterior: Confidence,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn update_confidence<'life0, 'async_trait>(
&'life0 self,
id: HypothesisId,
posterior: Confidence,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Update hypothesis confidence
Sourcefn set_status<'life0, 'async_trait>(
&'life0 self,
id: HypothesisId,
status: HypothesisStatus,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn set_status<'life0, 'async_trait>(
&'life0 self,
id: HypothesisId,
status: HypothesisStatus,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Set hypothesis status
Sourcefn list_hypotheses<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<Hypothesis>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_hypotheses<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<Hypothesis>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
List all hypotheses
Sourcefn delete_hypothesis<'life0, 'async_trait>(
&'life0 self,
id: HypothesisId,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn delete_hypothesis<'life0, 'async_trait>(
&'life0 self,
id: HypothesisId,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Delete a hypothesis
Sourcefn attach_evidence<'life0, 'life1, 'async_trait>(
&'life0 self,
evidence: &'life1 Evidence,
) -> Pin<Box<dyn Future<Output = Result<EvidenceId>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn attach_evidence<'life0, 'life1, 'async_trait>(
&'life0 self,
evidence: &'life1 Evidence,
) -> Pin<Box<dyn Future<Output = Result<EvidenceId>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Attach evidence to a hypothesis
Sourcefn get_evidence<'life0, 'async_trait>(
&'life0 self,
id: EvidenceId,
) -> Pin<Box<dyn Future<Output = Result<Option<Evidence>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_evidence<'life0, 'async_trait>(
&'life0 self,
id: EvidenceId,
) -> Pin<Box<dyn Future<Output = Result<Option<Evidence>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get evidence by ID
Sourcefn list_evidence_for_hypothesis<'life0, 'async_trait>(
&'life0 self,
hypothesis_id: HypothesisId,
) -> Pin<Box<dyn Future<Output = Result<Vec<Evidence>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_evidence_for_hypothesis<'life0, 'async_trait>(
&'life0 self,
hypothesis_id: HypothesisId,
) -> Pin<Box<dyn Future<Output = Result<Vec<Evidence>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
List all evidence for a hypothesis
Sourcefn list_all_evidence<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<Evidence>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_all_evidence<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<Evidence>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
List all evidence
Sourcefn delete_evidence<'life0, 'async_trait>(
&'life0 self,
id: EvidenceId,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn delete_evidence<'life0, 'async_trait>(
&'life0 self,
id: EvidenceId,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Delete evidence