pub struct InMemoryHypothesisStorage { /* private fields */ }Expand description
In-memory storage for testing
Implementations§
Trait Implementations§
Source§impl Default for InMemoryHypothesisStorage
impl Default for InMemoryHypothesisStorage
Source§impl HypothesisStorage for InMemoryHypothesisStorage
impl HypothesisStorage for InMemoryHypothesisStorage
Source§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 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
Source§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 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
Source§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 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
Source§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 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
Source§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 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
Source§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 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
Source§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 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
Source§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 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
Source§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_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
Source§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 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
Source§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,
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
Auto Trait Implementations§
impl Freeze for InMemoryHypothesisStorage
impl !RefUnwindSafe for InMemoryHypothesisStorage
impl Send for InMemoryHypothesisStorage
impl Sync for InMemoryHypothesisStorage
impl Unpin for InMemoryHypothesisStorage
impl UnsafeUnpin for InMemoryHypothesisStorage
impl !UnwindSafe for InMemoryHypothesisStorage
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more