Struct Builder

Source
pub struct Builder { /* private fields */ }

Implementations§

Source§

impl Builder

Source

pub fn new() -> Self

Creates a new Builder for constructing a Config

Source

pub fn add_source<S, E>(self, source: S) -> Self
where E: Error + 'static, S: Source<Error = E> + 'static,

Adds a new Source such that the sources provided keys are available from the root.

Note: The order that sources are added, are the order that they are checked for values, so you want to add your source with the highest priority first.

Source

pub fn add_source_at_prefix<S, E, K>(self, source: S, prefix: K) -> Self
where E: Error + 'static, S: Source<Error = E> + 'static, K: AsRef<Key>,

Adds a new Source such that the sources provided keys are available from the supplied prefix.

Note: The order that sources are added, are the order that they are checked for values, so you want to add your source with the highest priority first.

Source

pub fn build(self) -> Config

Build the Config from the setup supplied by this builder

Auto Trait Implementations§

§

impl Freeze for Builder

§

impl !RefUnwindSafe for Builder

§

impl !Send for Builder

§

impl !Sync for Builder

§

impl Unpin for Builder

§

impl !UnwindSafe for Builder

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.