ConfigManager

Trait ConfigManager 

Source
pub trait ConfigManager: Send + Sync {
    // Required methods
    fn load_config<'life0, 'life1, 'async_trait>(
        &'life0 self,
        path: &'life1 Path,
    ) -> Pin<Box<dyn Future<Output = Result<ActrConfig>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn save_config<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        config: &'life1 ActrConfig,
        path: &'life2 Path,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn update_dependency<'life0, 'life1, 'async_trait>(
        &'life0 self,
        spec: &'life1 DependencySpec,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn validate_config<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<ConfigValidation>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_project_root(&self) -> &Path;
    fn backup_config<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<ConfigBackup>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn restore_backup<'life0, 'async_trait>(
        &'life0 self,
        backup: ConfigBackup,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn remove_backup<'life0, 'async_trait>(
        &'life0 self,
        backup: ConfigBackup,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

统一的配置管理接口

Required Methods§

Source

fn load_config<'life0, 'life1, 'async_trait>( &'life0 self, path: &'life1 Path, ) -> Pin<Box<dyn Future<Output = Result<ActrConfig>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

加载配置文件

Source

fn save_config<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, config: &'life1 ActrConfig, path: &'life2 Path, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

保存配置文件

Source

fn update_dependency<'life0, 'life1, 'async_trait>( &'life0 self, spec: &'life1 DependencySpec, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

更新依赖配置

Source

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

验证配置文件

Source

fn get_project_root(&self) -> &Path

获取项目根目录

Source

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

备份当前配置

Source

fn restore_backup<'life0, 'async_trait>( &'life0 self, backup: ConfigBackup, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

恢复配置备份

Source

fn remove_backup<'life0, 'async_trait>( &'life0 self, backup: ConfigBackup, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

删除配置备份

Implementors§