pub struct ExperimentRepo<'a> { /* private fields */ }Expand description
Repository for experiments.
Implementations§
Source§impl<'a> ExperimentRepo<'a>
impl<'a> ExperimentRepo<'a>
Sourcepub async fn insert(&self, exp: &Experiment) -> Result<(), StorageError>
pub async fn insert(&self, exp: &Experiment) -> Result<(), StorageError>
Insert a new experiment.
Sourcepub async fn get_running_for_project(
&self,
project_id: ProjectId,
) -> Result<Option<Experiment>, StorageError>
pub async fn get_running_for_project( &self, project_id: ProjectId, ) -> Result<Option<Experiment>, StorageError>
Return the single running experiment for a project, if any.
Sourcepub async fn list_completed(
&self,
project_id: ProjectId,
) -> Result<Vec<Experiment>, StorageError>
pub async fn list_completed( &self, project_id: ProjectId, ) -> Result<Vec<Experiment>, StorageError>
List all non-Running experiments for a project, most recent first.
Sourcepub async fn update_status(
&self,
id: ExperimentId,
status: ExperimentStatus,
decided_at: Option<DateTime<Utc>>,
decision_posterior: Option<f64>,
) -> Result<(), StorageError>
pub async fn update_status( &self, id: ExperimentId, status: ExperimentStatus, decided_at: Option<DateTime<Utc>>, decision_posterior: Option<f64>, ) -> Result<(), StorageError>
Update the lifecycle state (and decision timestamp + posterior on terminal transitions).
Trait Implementations§
Source§impl<'a> Clone for ExperimentRepo<'a>
impl<'a> Clone for ExperimentRepo<'a>
Source§fn clone(&self) -> ExperimentRepo<'a>
fn clone(&self) -> ExperimentRepo<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<'a> Freeze for ExperimentRepo<'a>
impl<'a> !RefUnwindSafe for ExperimentRepo<'a>
impl<'a> Send for ExperimentRepo<'a>
impl<'a> Sync for ExperimentRepo<'a>
impl<'a> Unpin for ExperimentRepo<'a>
impl<'a> UnsafeUnpin for ExperimentRepo<'a>
impl<'a> !UnwindSafe for ExperimentRepo<'a>
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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