pub struct ExampleConfig {
pub c_p_a_t_h: String,
pub Section: Section,
}
Expand description
Configuration schema struct.
Basically is a struct of all sections. User will need to use Config.Section.Key
to access value.
Fields§
§c_p_a_t_h: String
§Section: Section
Implementations§
Source§impl ExampleConfig
impl ExampleConfig
Sourcepub fn verify(&self) -> Result<(), OVConfigError>
pub fn verify(&self) -> Result<(), OVConfigError>
Sanity check convenience function
This function will exec the closure on each field with the input of the field’s value.
Change c_p_a_t_h
will change the path that cached inthe configuration object.
Sourcepub fn get_config_no_verify<T: AsRef<str> + ?Sized>(
path: &T,
) -> Result<Self, OVConfigError>
pub fn get_config_no_verify<T: AsRef<str> + ?Sized>( path: &T, ) -> Result<Self, OVConfigError>
Sourcepub fn get_config<T: AsRef<str> + ?Sized>(
path: &T,
) -> Result<Self, OVConfigError>
pub fn get_config<T: AsRef<str> + ?Sized>( path: &T, ) -> Result<Self, OVConfigError>
Sourcepub fn refresh(&mut self) -> Result<(), OVConfigError>
pub fn refresh(&mut self) -> Result<(), OVConfigError>
Read the configuration file and update current object.
This function will automatically do sanity check on the value.
Sourcepub fn refresh_no_verify(&mut self) -> Result<(), OVConfigError>
pub fn refresh_no_verify(&mut self) -> Result<(), OVConfigError>
Read the configuration file and update current object.
This function will NOT automatically do sanity check on the value.
Sourcepub fn flush(&self) -> Result<(), OVConfigError>
pub fn flush(&self) -> Result<(), OVConfigError>
Flush whatever in configuration object to file.
This function will automatically do sanity check on the value.
Sourcepub fn flush_no_verify(&self) -> Result<(), OVConfigError>
pub fn flush_no_verify(&self) -> Result<(), OVConfigError>
Flush whatever in configuration object to file.
This function will automatically do sanity check on the value.