Skip to main content

SettingRepository

Trait SettingRepository 

Source
pub trait SettingRepository: Send + Sync {
    // Required methods
    fn get_project_setting<'life0, 'async_trait>(
        &'life0 self,
        project_id: i64,
        name: SettingName,
    ) -> Pin<Box<dyn Future<Output = Result<Option<String>, DbError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_setting<'life0, 'async_trait>(
        &'life0 self,
        name: SettingName,
    ) -> Pin<Box<dyn Future<Output = Result<Option<String>, DbError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn load_active_project_id<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Option<i64>, DbError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn load_project_reasoning_level<'life0, 'async_trait>(
        &'life0 self,
        project_id: i64,
        name: SettingName,
    ) -> Pin<Box<dyn Future<Output = Result<ReasoningLevel, DbError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn set_active_project_id<'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_setting<'life0, 'life1, 'async_trait>(
        &'life0 self,
        project_id: i64,
        name: SettingName,
        value: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<(), DbError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn upsert_project_settings<'life0, 'async_trait>(
        &'life0 self,
        project_id: i64,
        settings: Vec<(SettingName, String)>,
    ) -> Pin<Box<dyn Future<Output = Result<(), DbError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn upsert_setting<'life0, 'life1, 'async_trait>(
        &'life0 self,
        name: SettingName,
        value: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<(), DbError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Settings-focused persistence boundary used by app orchestration and tests.

Required Methods§

Source

fn get_project_setting<'life0, 'async_trait>( &'life0 self, project_id: i64, name: SettingName, ) -> Pin<Box<dyn Future<Output = Result<Option<String>, DbError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Looks up one project-scoped setting value by project and name.

Source

fn get_setting<'life0, 'async_trait>( &'life0 self, name: SettingName, ) -> Pin<Box<dyn Future<Output = Result<Option<String>, DbError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Looks up a setting value by name.

Source

fn load_active_project_id<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Option<i64>, DbError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Loads the active project identifier from application settings.

Source

fn load_project_reasoning_level<'life0, 'async_trait>( &'life0 self, project_id: i64, name: SettingName, ) -> Pin<Box<dyn Future<Output = Result<ReasoningLevel, DbError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Loads one project-scoped reasoning-effort setting.

Source

fn set_active_project_id<'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,

Persists the active project identifier in application settings.

Source

fn upsert_project_setting<'life0, 'life1, 'async_trait>( &'life0 self, project_id: i64, name: SettingName, value: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<(), DbError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Inserts or updates one project-scoped setting by project and name.

Source

fn upsert_project_settings<'life0, 'async_trait>( &'life0 self, project_id: i64, settings: Vec<(SettingName, String)>, ) -> Pin<Box<dyn Future<Output = Result<(), DbError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Inserts or updates project-scoped settings as one transaction.

Source

fn upsert_setting<'life0, 'life1, 'async_trait>( &'life0 self, name: SettingName, value: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<(), DbError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Inserts or updates a setting by name.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§