pub struct CleanupConfig {
pub enabled: bool,
pub preserve_extensions: Vec<String>,
pub verbose: u32,
pub cleanup_frequency: u32,
pub print_level: u32,
}Expand description
Configuration for cleanup operations.
Fields§
§enabled: boolEnable automatic cleanup
preserve_extensions: Vec<String>File extensions to preserve (whitelist)
verbose: u32Verbosity level for cleanup logging
cleanup_frequency: u32Perform cleanup every N optimization steps (default: 5) Set to 0 to disable periodic cleanup
print_level: u32Global print level from general settings (0=quiet, 1=normal, 2=verbose)
Implementations§
Source§impl CleanupConfig
impl CleanupConfig
Sourcepub fn from_settings_manager(
settings_manager: &SettingsManager,
program: QMProgram,
) -> Self
pub fn from_settings_manager( settings_manager: &SettingsManager, program: QMProgram, ) -> Self
Creates a cleanup configuration from settings manager.
This integrates with omecp_config.cfg to get the user-specified output extension for the QM program and adds it to the whitelist.
§Arguments
settings_manager- Settings manager containing configurationprogram- QM program type
§Returns
Returns a CleanupConfig with the whitelist of files to preserve
Sourcepub fn get_preserve_extensions(&self) -> &[String]
pub fn get_preserve_extensions(&self) -> &[String]
Gets the list of preserve extensions
Sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Checks if cleanup is enabled
Sourcepub fn cleanup_frequency(&self) -> u32
pub fn cleanup_frequency(&self) -> u32
Gets cleanup frequency (every N steps)
Sourcepub fn should_log(&self, min_verbose_level: u32) -> bool
pub fn should_log(&self, min_verbose_level: u32) -> bool
Checks if logging should occur based on print_level and verbose settings.
This combines the global print_level with the cleanup-specific verbose setting:
- If print_level is 0 (quiet), no cleanup messages are printed regardless of verbose
- If print_level is 1 (normal), messages are printed based on verbose level
- If print_level is 2 (verbose), all messages are printed
§Arguments
min_verbose_level- Minimum verbose level required (0, 1, or 2)
§Returns
Returns true if logging should occur, false otherwise
Trait Implementations§
Source§impl Clone for CleanupConfig
impl Clone for CleanupConfig
Source§fn clone(&self) -> CleanupConfig
fn clone(&self) -> CleanupConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CleanupConfig
impl Debug for CleanupConfig
Auto Trait Implementations§
impl Freeze for CleanupConfig
impl RefUnwindSafe for CleanupConfig
impl Send for CleanupConfig
impl Sync for CleanupConfig
impl Unpin for CleanupConfig
impl UnsafeUnpin for CleanupConfig
impl UnwindSafe for CleanupConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.