pub struct Config {
pub latest_version: String,
pub path: String,
pub config_file_path: String,
/* private fields */
}Expand description
describe configuration folder
Fields
latest_version: Stringpath: StringConfiguration folder path.
config_file_path: Stringconfig file.
Implementations
sourceimpl Config
impl Config
sourcepub fn load_config_from_file(&self) -> AnyResult<Context>
pub fn load_config_from_file(&self) -> AnyResult<Context>
Convert user config yaml to struct.
Errors
Will return Err has an error when loading the config file
sourcepub fn load_default_config(&self) -> AnyResult<Context>
pub fn load_default_config(&self) -> AnyResult<Context>
sourcepub fn update_config_version(&self, config: &Context) -> AnyResult<()>
pub fn update_config_version(&self, config: &Context) -> AnyResult<()>
update config file with the updated baseline checks.
Errors
Will return Err adding check group return an error
sourcepub fn manage_config_file(&self) -> AnyResult<()>
pub fn manage_config_file(&self) -> AnyResult<()>
Manage configuration folder & file.
- Create config folder if not exists.
- Create default config yaml file if not exists.
Errors
Will return Err file could not created or loaded
sourcepub fn update_config_content(
&self,
remove_checks: bool,
check_groups: &[String]
) -> AnyResult<()>
pub fn update_config_content(
&self,
remove_checks: bool,
check_groups: &[String]
) -> AnyResult<()>
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more