pub trait ProjectRepository: Send + Sync {
// Required methods
fn get_project<'life0, 'async_trait>(
&'life0 self,
id: i64,
) -> Pin<Box<dyn Future<Output = Result<Option<ProjectRow>, DbError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn load_projects_with_stats<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<ProjectListRow>, DbError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn touch_project_last_opened<'life0, 'async_trait>(
&'life0 self,
project_id: i64,
) -> Pin<Box<dyn Future<Output = Result<(), DbError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn upsert_project<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str,
git_branch: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<i64, DbError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
Project-focused persistence boundary used by app orchestration and tests.
Required Methods§
Sourcefn get_project<'life0, 'async_trait>(
&'life0 self,
id: i64,
) -> Pin<Box<dyn Future<Output = Result<Option<ProjectRow>, DbError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_project<'life0, 'async_trait>(
&'life0 self,
id: i64,
) -> Pin<Box<dyn Future<Output = Result<Option<ProjectRow>, DbError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Looks up a project by identifier.
Sourcefn load_projects_with_stats<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<ProjectListRow>, DbError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn load_projects_with_stats<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<ProjectListRow>, DbError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Loads all configured projects with aggregated session stats.
Sourcefn touch_project_last_opened<'life0, 'async_trait>(
&'life0 self,
project_id: i64,
) -> Pin<Box<dyn Future<Output = Result<(), DbError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn touch_project_last_opened<'life0, 'async_trait>(
&'life0 self,
project_id: i64,
) -> Pin<Box<dyn Future<Output = Result<(), DbError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Marks a project as recently opened at the current Unix timestamp.
Sourcefn upsert_project<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str,
git_branch: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<i64, DbError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn upsert_project<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str,
git_branch: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<i64, DbError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Inserts or updates a project by path and returns its identifier.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".