pub trait ConfigRepository<DB: Database>: DatabaseRepository<DB> {
// Required methods
fn get_global_config<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<GlobalConfig>, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn save_global_config<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 GlobalConfig,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_config_history<'life0, 'async_trait>(
&'life0 self,
limit: Option<i64>,
) -> Pin<Box<dyn Future<Output = Result<Vec<GlobalConfig>, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
配置数据库仓库
Required Methods§
Sourcefn get_global_config<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<GlobalConfig>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_global_config<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<GlobalConfig>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
获取全局配置
Sourcefn save_global_config<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 GlobalConfig,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn save_global_config<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 GlobalConfig,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
保存全局配置