pub struct ConfigurationManager { /* private fields */ }Expand description
High-level configuration manager
Implementations§
Source§impl ConfigurationManager
impl ConfigurationManager
pub fn new() -> Result<Self>
pub fn with_provider(provider: Box<dyn ConfigProvider>) -> Self
pub fn with_yaml_provider() -> Result<Self>
Sourcepub fn invalidate_cache(&mut self)
pub fn invalidate_cache(&mut self)
Invalidate cache
Source§impl ConfigurationManager
impl ConfigurationManager
Sourcepub async fn load_config(&self) -> Result<Config>
pub async fn load_config(&self) -> Result<Config>
Convenience method that matches the expected API
Sourcepub async fn save_config(&self, config: &Config) -> Result<()>
pub async fn save_config(&self, config: &Config) -> Result<()>
Convenience method that matches the expected API
Sourcepub async fn add_organization(&self, name: String) -> Result<()>
pub async fn add_organization(&self, name: String) -> Result<()>
Add an organization to the configuration
Sourcepub async fn remove_organization(&self, name: &str) -> Result<()>
pub async fn remove_organization(&self, name: &str) -> Result<()>
Remove an organization from the configuration
Sourcepub async fn add_repository(&self, repo: String) -> Result<()>
pub async fn add_repository(&self, repo: String) -> Result<()>
Add a repository to the configuration
Sourcepub async fn remove_repository(&self, repo: &str) -> Result<()>
pub async fn remove_repository(&self, repo: &str) -> Result<()>
Remove a repository from the configuration
Sourcepub async fn load_state(&self) -> Result<SyncState>
pub async fn load_state(&self) -> Result<SyncState>
Load state information (placeholder for now)
Sourcepub async fn ensure_config_dir(&self) -> Result<()>
pub async fn ensure_config_dir(&self) -> Result<()>
Ensure configuration directory exists
Sourcepub fn config_path(&self) -> &Path
pub fn config_path(&self) -> &Path
Get configuration file path
Sourcepub fn config_dir(&self) -> &Path
pub fn config_dir(&self) -> &Path
Get configuration directory path
Trait Implementations§
Source§impl ConfigManager for ConfigurationManager
impl ConfigManager for ConfigurationManager
Source§fn initialize<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Config>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn initialize<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Config>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Initialize configuration with defaults
Source§fn load<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Config>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn load<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Config>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Load current configuration
Source§fn save<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 Config,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn save<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 Config,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Save configuration
Source§fn update_section<'life0, 'life1, 'async_trait, T>(
&'life0 self,
_section: &'life1 str,
_data: T,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
fn update_section<'life0, 'life1, 'async_trait, T>( &'life0 self, _section: &'life1 str, _data: T, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
Update specific configuration section
Auto Trait Implementations§
impl Freeze for ConfigurationManager
impl !RefUnwindSafe for ConfigurationManager
impl Send for ConfigurationManager
impl Sync for ConfigurationManager
impl Unpin for ConfigurationManager
impl !UnwindSafe for ConfigurationManager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more