pub struct ProjectRepo<'a> { /* private fields */ }Expand description
Repository for projects.
Implementations§
Source§impl<'a> ProjectRepo<'a>
impl<'a> ProjectRepo<'a>
Sourcepub async fn insert(&self, project: &Project) -> Result<(), StorageError>
pub async fn insert(&self, project: &Project) -> Result<(), StorageError>
Insert a new project row. Caller supplies the id.
Sourcepub async fn get_by_id(
&self,
id: ProjectId,
) -> Result<Option<Project>, StorageError>
pub async fn get_by_id( &self, id: ProjectId, ) -> Result<Option<Project>, StorageError>
Fetch by id; returns Ok(None) if no row matches.
Sourcepub async fn get_by_root_path(
&self,
root: &str,
) -> Result<Option<Project>, StorageError>
pub async fn get_by_root_path( &self, root: &str, ) -> Result<Option<Project>, StorageError>
Fetch by root path.
Sourcepub async fn list(&self) -> Result<Vec<Project>, StorageError>
pub async fn list(&self) -> Result<Vec<Project>, StorageError>
List all projects, most recently created first.
Sourcepub async fn delete(&self, id: ProjectId) -> Result<(), StorageError>
pub async fn delete(&self, id: ProjectId) -> Result<(), StorageError>
Delete a project and cascade (configs, experiments, sessions, signals go too).
Sourcepub async fn set_champion(
&self,
id: ProjectId,
config_id: ConfigId,
) -> Result<(), StorageError>
pub async fn set_champion( &self, id: ProjectId, config_id: ConfigId, ) -> Result<(), StorageError>
Update the champion config pointer (used when a challenger is promoted).
Trait Implementations§
Source§impl<'a> Clone for ProjectRepo<'a>
impl<'a> Clone for ProjectRepo<'a>
Source§fn clone(&self) -> ProjectRepo<'a>
fn clone(&self) -> ProjectRepo<'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 ProjectRepo<'a>
impl<'a> !RefUnwindSafe for ProjectRepo<'a>
impl<'a> Send for ProjectRepo<'a>
impl<'a> Sync for ProjectRepo<'a>
impl<'a> Unpin for ProjectRepo<'a>
impl<'a> UnsafeUnpin for ProjectRepo<'a>
impl<'a> !UnwindSafe for ProjectRepo<'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