Struct cfg_rs::ConfigContext
source · pub struct ConfigContext<'a> { /* private fields */ }Expand description
Configuration Context.
Configuration context contains current level of config key and configuration instance. It is designed for parsing partial config by partial key and default value.
Implementations§
source§impl<'a> ConfigContext<'a>
impl<'a> ConfigContext<'a>
sourcepub fn parse_config<T: FromConfig>(
&mut self,
partial_key: &'a str,
default_value: Option<ConfigValue<'_>>
) -> Result<T, ConfigError>
pub fn parse_config<T: FromConfig>( &mut self, partial_key: &'a str, default_value: Option<ConfigValue<'_>> ) -> Result<T, ConfigError>
Parse partial config by partial key and default value.
sourcepub fn current_key(&self) -> String
pub fn current_key(&self) -> String
Get current key in context.
sourcepub fn parse_error(&self, value: &str) -> ConfigError
pub fn parse_error(&self, value: &str) -> ConfigError
Parse config value error.
Auto Trait Implementations§
impl<'a> RefUnwindSafe for ConfigContext<'a>
impl<'a> Send for ConfigContext<'a>
impl<'a> Sync for ConfigContext<'a>
impl<'a> Unpin for ConfigContext<'a>
impl<'a> !UnwindSafe for ConfigContext<'a>
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