Trait Configurable

Source
pub trait Configurable<E: Env> {
    type Config: Clone + DeserializeOwned;

    // Required method
    fn build(config: Self::Config) -> Self;

    // Provided method
    fn build_from_path(path: impl AsRef<Path>) -> Result<Self>
       where Self: Sized { ... }
}
Expand description

A configurable object, having type parameter.

Required Associated Types§

Source

type Config: Clone + DeserializeOwned

Configuration.

Required Methods§

Source

fn build(config: Self::Config) -> Self

Builds the object.

Provided Methods§

Source

fn build_from_path(path: impl AsRef<Path>) -> Result<Self>
where Self: Sized,

Build the object with the configuration in the yaml file of the given path.

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§