Skip to main content

ConfigLoader

Trait ConfigLoader 

Source
pub trait ConfigLoader<T>{
    // Provided methods
    fn try_from_str(value: &str) -> Result<T, DynError> { ... }
    fn load<'async_trait>(
        path: impl 'async_trait + AsRef<Path> + Send,
    ) -> Pin<Box<dyn Future<Output = Result<T, DynError>> + Send + 'async_trait>>
       where Self: Send + 'async_trait { ... }
}

Provided Methods§

Source

fn try_from_str(value: &str) -> Result<T, DynError>

Parses the struct from a TOML string

Source

fn load<'async_trait>( path: impl 'async_trait + AsRef<Path> + Send, ) -> Pin<Box<dyn Future<Output = Result<T, DynError>> + Send + 'async_trait>>
where Self: Send + 'async_trait,

Loads the struct from a TOML file

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§