Skip to main content

ConfigLoader

Trait ConfigLoader 

Source
pub trait ConfigLoader: Sized + DeserializeOwned {
    // Provided methods
    fn load(path: &Path) -> Result<Self, IacForgeError> { ... }
    fn from_toml(content: &str) -> Result<Self, IacForgeError> { ... }
}
Expand description

Trait for loading specs from TOML.

Eliminates identical load() methods across spec types. Provides both file-based loading and string-based parsing (useful for tests).

Provided Methods§

Source

fn load(path: &Path) -> Result<Self, IacForgeError>

Load from a TOML file.

§Errors

Returns an error if the file can’t be read or parsed.

Source

fn from_toml(content: &str) -> Result<Self, IacForgeError>

Parse from a TOML string (useful for tests).

§Errors

Returns an error if the string can’t be parsed.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§