Struct fregate::AppConfigBuilder
source · pub struct AppConfigBuilder<ConfigExt> { /* private fields */ }Expand description
AppConfig builder to set up multiple sources
Implementations§
source§impl<ConfigExt> AppConfigBuilder<ConfigExt>
impl<ConfigExt> AppConfigBuilder<ConfigExt>
sourcepub fn new() -> Self
pub fn new() -> Self
Creates new AppConfigBuilder
sourcepub fn build(self) -> Result<AppConfig<ConfigExt>>where
ConfigExt: Debug + DeserializeOwned,
pub fn build(self) -> Result<AppConfig<ConfigExt>>where ConfigExt: Debug + DeserializeOwned,
Reads all registered sources
sourcepub fn add_default(self) -> Self
pub fn add_default(self) -> Self
Add default config
sourcepub fn add_str(self, str: &str, format: FileFormat) -> Self
pub fn add_str(self, str: &str, format: FileFormat) -> Self
Add string
sourcepub fn add_env_prefixed(self, prefix: &str) -> Self
pub fn add_env_prefixed(self, prefix: &str) -> Self
Add environment variables with specified prefix and default separator: “_”
Trait Implementations§
source§impl<ConfigExt: Debug> Debug for AppConfigBuilder<ConfigExt>
impl<ConfigExt: Debug> Debug for AppConfigBuilder<ConfigExt>
source§impl<ConfigExt: Default> Default for AppConfigBuilder<ConfigExt>
impl<ConfigExt: Default> Default for AppConfigBuilder<ConfigExt>
source§fn default() -> AppConfigBuilder<ConfigExt>
fn default() -> AppConfigBuilder<ConfigExt>
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl<ConfigExt> !RefUnwindSafe for AppConfigBuilder<ConfigExt>
impl<ConfigExt> Send for AppConfigBuilder<ConfigExt>where ConfigExt: Send,
impl<ConfigExt> Sync for AppConfigBuilder<ConfigExt>where ConfigExt: Sync,
impl<ConfigExt> Unpin for AppConfigBuilder<ConfigExt>where ConfigExt: Unpin,
impl<ConfigExt> !UnwindSafe for AppConfigBuilder<ConfigExt>
Blanket Implementations§
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request