pub struct CfgContext(/* private fields */);Expand description
Metadata and lookup access for a shared configuration.
The id, tag, and service name stay readable for as long as the context
exists. Lookups need the configuration itself, see CfgContext::get.
Implementations§
Source§impl CfgContext
impl CfgContext
Sourcepub fn service(&self) -> &'static str
pub fn service(&self) -> &'static str
Returns the configured service name.
Returns the tag while the configuration is being built.
Sourcepub fn get<T>(&self) -> Cfg<T>where
T: Configuration,
pub fn get<T>(&self) -> Cfg<T>where
T: Configuration,
Returns a typed configuration value from the same shared configuration.
A missing value falls back to a per-thread default, as described in
SharedCfg::get.
§Panics
Panics while the shared configuration is being built, for example from
Configuration::set_ctx during SharedCfgBuilder::add or after its
builder was dropped, and after the shared configuration was dropped.
Returns a handle to the complete shared configuration.
§Panics
Panics in the same cases as CfgContext::get.
Trait Implementations§
Source§impl Debug for CfgContext
impl Debug for CfgContext
Auto Trait Implementations§
impl !RefUnwindSafe for CfgContext
impl !UnwindSafe for CfgContext
impl Freeze for CfgContext
impl Send for CfgContext
impl Sync for CfgContext
impl Unpin for CfgContext
impl UnsafeUnpin for CfgContext
Blanket Implementations§
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