Config

Trait Config 

Source
pub trait Config
where Self: Sized,
{ // Required methods fn load<P: AsRef<Path>>(path: P) -> Result<Self, ConfigError>; fn load_bytes(bytes: &[u8]) -> Result<Self, ConfigError>; fn write<P: AsRef<Path>>(&self, path: P) -> Result<(), ConfigError>; // Provided method fn load_no_fallback<P: AsRef<Path>>(path: P) -> Result<Self, ConfigError> { ... } }
Expand description

Trait implemented by the config! macro.

Required Methods§

Source

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

Loads a configuration structure from a file.

Source

fn load_bytes(bytes: &[u8]) -> Result<Self, ConfigError>

Loads configuration structure from raw bytes.

Source

fn write<P: AsRef<Path>>(&self, path: P) -> Result<(), ConfigError>

Writes a configuration structure to a file.

Provided Methods§

Source

fn load_no_fallback<P: AsRef<Path>>(path: P) -> Result<Self, ConfigError>

👎Deprecated: use load instead

Loads a configuration structure from a file.

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§

Source§

impl<T> Config for T
where T: for<'a> Deserialize<'a> + Serialize,