[−][src]Struct ov_config::ExampleConfig
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
Methods
impl ExampleConfig
[src]
pub fn verify(&self) -> Result<(), OVConfigError>
[src]
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.
pub fn get_config_no_verify<T: AsRef<str> + ?Sized>(
path: &T
) -> Result<Self, OVConfigError>
[src]
path: &T
) -> Result<Self, OVConfigError>
Get configuration without auto verification.
Will use default value if specific field is not found in the configuration file.
Argument:
- path: Path to the configuration. This path will be cached in the object for refresh and flush.
Return:
Will return configuration object on success.
pub fn get_config<T: AsRef<str> + ?Sized>(
path: &T
) -> Result<Self, OVConfigError>
[src]
path: &T
) -> Result<Self, OVConfigError>
Get configuration with auto verification.
Will use default value if specific field is not found in the configuration file.
Argument:
- path: Path to the configuration. This path will be cached in the object for refresh and flush.
Return:
Will return configuration object on success.
pub fn refresh(&mut self) -> Result<(), OVConfigError>
[src]
Read the configuration file and update current object.
This function will automatically do sanity check on the value.
pub fn refresh_no_verify(&mut self) -> Result<(), OVConfigError>
[src]
Read the configuration file and update current object.
This function will NOT automatically do sanity check on the value.
pub fn flush(&self) -> Result<(), OVConfigError>
[src]
Flush whatever in configuration object to file.
This function will automatically do sanity check on the value.
pub fn flush_no_verify(&self) -> Result<(), OVConfigError>
[src]
Flush whatever in configuration object to file.
This function will automatically do sanity check on the value.
Trait Implementations
impl PartialEq<ExampleConfig> for ExampleConfig
[src]
fn eq(&self, other: &ExampleConfig) -> bool
[src]
fn ne(&self, other: &ExampleConfig) -> bool
[src]
impl Default for ExampleConfig
[src]
fn default() -> ExampleConfig
[src]
impl Debug for ExampleConfig
[src]
Auto Trait Implementations
impl Unpin for ExampleConfig
impl Sync for ExampleConfig
impl Send for ExampleConfig
impl RefUnwindSafe for ExampleConfig
impl UnwindSafe for ExampleConfig
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,