Skip to main content

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<ManifestConfig>> + 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 ManifestConfig,
        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

Unified configuration management interface

Required Methods§

Source

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

Load configuration file

Source

fn save_config<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, config: &'life1 ManifestConfig, 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,

Save configuration file

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,

Update dependency configuration

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,

Validate configuration file

Source

fn get_project_root(&self) -> &Path

Get project root directory

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,

Back up current configuration

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,

Restore configuration backup

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,

Remove configuration backup

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§