Skip to main content
← OpenMECP Documentation

CleanupConfig

Struct CleanupConfig 

Source
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: bool

Enable automatic cleanup

§preserve_extensions: Vec<String>

File extensions to preserve (whitelist)

§verbose: u32

Verbosity level for cleanup logging

§cleanup_frequency: u32

Perform cleanup every N optimization steps (default: 5) Set to 0 to disable periodic cleanup

§print_level: u32

Global print level from general settings (0=quiet, 1=normal, 2=verbose)

Implementations§

Source§

impl CleanupConfig

Source

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 configuration
  • program - QM program type
§Returns

Returns a CleanupConfig with the whitelist of files to preserve

Source

pub fn get_preserve_extensions(&self) -> &[String]

Gets the list of preserve extensions

Source

pub fn is_enabled(&self) -> bool

Checks if cleanup is enabled

Source

pub fn verbosity(&self) -> u32

Gets verbosity level

Source

pub fn cleanup_frequency(&self) -> u32

Gets cleanup frequency (every N steps)

Source

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

Source§

fn clone(&self) -> CleanupConfig

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CleanupConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for CleanupConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.