Trait Config

Source
pub trait Config{
    // Provided methods
    fn persisted(self, path: &Path) -> PersistedConfig<Self> { ... }
    fn load<P: AsRef<Path>>(path: P) -> Result<Self, Error> { ... }
    fn save<P: AsRef<Path>>(&self, path: P) -> Result<(), Error> { ... }
    fn load_with_lock<P: AsRef<Path>>(path: P) -> Result<Self, Error> { ... }
    fn save_with_lock<P: AsRef<Path>>(&self, path: P) -> Result<(), Error> { ... }
}

Provided Methods§

Source

fn persisted(self, path: &Path) -> PersistedConfig<Self>

Source

fn load<P: AsRef<Path>>(path: P) -> Result<Self, Error>

Source

fn save<P: AsRef<Path>>(&self, path: P) -> Result<(), Error>

Source

fn load_with_lock<P: AsRef<Path>>(path: P) -> Result<Self, Error>

Load the config from the given path, acquiring a shared lock on the file during the read.

Source

fn save_with_lock<P: AsRef<Path>>(&self, path: P) -> Result<(), Error>

Save the config to the given path, acquiring an exclusive lock on the file during the write.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§