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> Freeze for ConfigContext<'a>
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