pub trait ConfigStore: Send + Sync {
// Required methods
fn read(&self, path: &Path) -> Result<Option<String>, ConfigStoreError>;
fn write(&self, path: &Path, content: &str) -> Result<(), ConfigStoreError>;
}Expand description
Abstracts filesystem access for config file operations.
Args:
path- The path to the config file.
Usage:
ⓘ
let content = store.read(Path::new("~/.auths/config.toml"))?;
store.write(Path::new("~/.auths/config.toml"), "content")?;Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".