pub struct ConfigBuilder { /* private fields */ }Expand description
Configuration builder for easy integration into parent applications
Implementations§
Source§impl ConfigBuilder
impl ConfigBuilder
Sourcepub fn with_env_prefix(self, prefix: impl Into<String>) -> Self
pub fn with_env_prefix(self, prefix: impl Into<String>) -> Self
Set the environment variable prefix
Sourcepub fn without_defaults(self) -> Self
pub fn without_defaults(self) -> Self
Disable loading of default auth-framework configuration files
Sourcepub fn add_file<P: AsRef<Path>>(self, path: P, required: bool) -> Self
pub fn add_file<P: AsRef<Path>>(self, path: P, required: bool) -> Self
Add a configuration file source
Sourcepub fn add_file_with_format<P: AsRef<Path>>(
self,
path: P,
format: FileFormat,
required: bool,
) -> Self
pub fn add_file_with_format<P: AsRef<Path>>( self, path: P, format: FileFormat, required: bool, ) -> Self
Add a configuration file with explicit format
Sourcepub fn add_env_source(self, prefix: impl Into<String>) -> Self
pub fn add_env_source(self, prefix: impl Into<String>) -> Self
Add environment variables as a source
Sourcepub fn add_values(self, values: HashMap<String, Value>) -> Self
pub fn add_values(self, values: HashMap<String, Value>) -> Self
Add direct configuration values
Sourcepub fn add_include_dir(
self,
path: impl Into<String>,
pattern: impl Into<String>,
) -> Self
pub fn add_include_dir( self, path: impl Into<String>, pattern: impl Into<String>, ) -> Self
Add a directory include source (loads all matching files)
Sourcepub fn add_search_path(self, path: impl Into<String>) -> Self
pub fn add_search_path(self, path: impl Into<String>) -> Self
Add a search path for configuration files
Sourcepub fn build(self) -> Result<ConfigManager>
pub fn build(self) -> Result<ConfigManager>
Build the configuration manager
Trait Implementations§
Source§impl Clone for ConfigBuilder
impl Clone for ConfigBuilder
Source§fn clone(&self) -> ConfigBuilder
fn clone(&self) -> ConfigBuilder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ConfigBuilder
impl Debug for ConfigBuilder
Auto Trait Implementations§
impl Freeze for ConfigBuilder
impl RefUnwindSafe for ConfigBuilder
impl Send for ConfigBuilder
impl Sync for ConfigBuilder
impl Unpin for ConfigBuilder
impl UnwindSafe for ConfigBuilder
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more