pub struct ConfigManager;Expand description
Configuration manager for loading and saving config
Implementations§
Source§impl ConfigManager
impl ConfigManager
Sourcepub fn config_path() -> CarpResult<PathBuf>
pub fn config_path() -> CarpResult<PathBuf>
Get the path to the config file
Sourcepub fn load() -> CarpResult<Config>
pub fn load() -> CarpResult<Config>
Load configuration from file, creating default if it doesn’t exist
Sourcepub fn save(config: &Config) -> CarpResult<()>
pub fn save(config: &Config) -> CarpResult<()>
Save configuration to file
Sourcepub fn set_api_token(token: String) -> CarpResult<()>
pub fn set_api_token(token: String) -> CarpResult<()>
Update the API token in the config
Sourcepub fn clear_api_token() -> CarpResult<()>
pub fn clear_api_token() -> CarpResult<()>
Clear the API token from the config
Sourcepub fn cache_dir() -> CarpResult<PathBuf>
pub fn cache_dir() -> CarpResult<PathBuf>
Get the cache directory for storing downloaded agents
Auto Trait Implementations§
impl Freeze for ConfigManager
impl RefUnwindSafe for ConfigManager
impl Send for ConfigManager
impl Sync for ConfigManager
impl Unpin for ConfigManager
impl UnwindSafe for ConfigManager
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