Skip to main content

FileLoader

Trait FileLoader 

Source
pub trait FileLoader: Send + Sync {
    // Required method
    fn load(&self, contents: &str) -> Result<ValueMap, ConfigulatorError>;
}
Available on crate feature file only.
Expand description

Trait for parsing file contents into configuration values.

Implement this for any configuration format you want to support (YAML, TOML, JSON, etc.).

For formats supported by serde, use serde_loader instead of implementing this trait manually.

Required Methods§

Source

fn load(&self, contents: &str) -> Result<ValueMap, ConfigulatorError>

Parse the raw file contents into configuration values.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§