pub struct Builder<C: Config> { /* private fields */ }
Expand description
Convenience builder to configure, load and merge multiple configuration sources.
Sources specified earlier have a higher priority. Obtained via
Config::builder
.
Implementations
sourceimpl<C: Config> Builder<C>
impl<C: Config> Builder<C>
sourcepub fn file(self, path: impl Into<PathBuf>) -> Self
pub fn file(self, path: impl Into<PathBuf>) -> Self
Adds a configuration file as source. Infers the format from the file
extension. If the path has no file extension or the extension is
unknown, Builder::load
will return an error.
The file is not considered required: if the file does not exist, an
empty configuration (C::Partial::empty()
) is used for this layer.
Auto Trait Implementations
impl<C> RefUnwindSafe for Builder<C> where
<C as Config>::Partial: RefUnwindSafe,
impl<C> Send for Builder<C> where
<C as Config>::Partial: Send,
impl<C> Sync for Builder<C> where
<C as Config>::Partial: Sync,
impl<C> Unpin for Builder<C> where
<C as Config>::Partial: Unpin,
impl<C> UnwindSafe for Builder<C> where
<C as Config>::Partial: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more