Source

Trait Source 

Source
pub trait Source<C: HasPartial> {
    type Error: Debug;

    // Required methods
    fn to_partial(self) -> Result<C::Partial, Self::Error>;
    fn name(&self) -> String;
}
Expand description

The implementor of this trait is a source of configuration. The method Source::to_partial obtains a single layer of configuration and from a given source.

This trait is mostly used for trait-level type checking so that the Partial::source method operates as expected. No user is ever expected to call Source::to_partial directly.

Required Associated Types§

Required Methods§

Source

fn to_partial(self) -> Result<C::Partial, Self::Error>

Obtain a partial layer from Self. Not user facing, but used inside the Partial::source for type checking.

Source

fn name(&self) -> String

The name that is being printed whenever this layer of configuration is being parsed. If you came across this method to silence the Sourcing configuration from XXX message, instead simply override the Partial::source method instead.

Implementations on Foreign Types§

Source§

impl<C> Source<C> for PathBuf

Source§

impl<T, C, E> Source<C> for Option<T>
where C: HasPartial, T: Source<C, Error = E>, E: Debug,

Source§

type Error = E

Source§

fn to_partial(self) -> Result<C::Partial, E>

Source§

fn name(&self) -> String

Implementors§