Skip to main content

DeriveYamlConfig

Trait DeriveYamlConfig 

Source
pub trait DeriveYamlConfig {
    // Required methods
    fn path() -> Result<PathBuf, ConfigError>;
    fn save(&self) -> Result<(), ConfigError>;
    fn and_save(self) -> Result<Self, ConfigError>
       where Self: Sized;
    fn load() -> Result<Self, ConfigError>
       where Self: Sized;
}

Required Methods§

Source

fn path() -> Result<PathBuf, ConfigError>

§Errors

Will return Err if dirs::config_dir fails.

Source

fn save(&self) -> Result<(), ConfigError>

§Errors

Will return Err if Self::path, File::open, format::to_string, or File::write_all fails.

Source

fn and_save(self) -> Result<Self, ConfigError>
where Self: Sized,

§Errors

Will return Err if Self::path, File::open, format::to_string, or File::write_all fails.

Source

fn load() -> Result<Self, ConfigError>
where Self: Sized,

§Errors

Will return Err if Self::path, File::open, File::read_to_string, File::rewind, or format::from_str fails.

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§