pub struct FileConfig {
pub project_type: Option<String>,
pub dir: Option<PathBuf>,
pub filtering: FileFilterConfig,
pub scanning: FileScanConfig,
pub execution: FileExecutionConfig,
}Expand description
Top-level configuration file structure.
All fields are Option<T> so we can detect which values are present in the
config file and apply layered configuration (CLI > config file > defaults).
Fields§
§project_type: Option<String>Default project type filter (e.g., "rust", "node", "all")
dir: Option<PathBuf>Default directory to scan
filtering: FileFilterConfigFiltering options
scanning: FileScanConfigScanning options
execution: FileExecutionConfigExecution options
Implementations§
Source§impl FileConfig
impl FileConfig
Sourcepub fn config_path() -> Option<PathBuf>
pub fn config_path() -> Option<PathBuf>
Returns the path where the configuration file is expected.
The configuration file is located at <config_dir>/clean-dev-dirs/config.toml,
where <config_dir> is the platform-specific configuration directory
(e.g., ~/.config on Linux/macOS, %APPDATA% on Windows).
§Returns
Some(PathBuf) with the config file path, or None if the config
directory cannot be determined.
Sourcepub fn load() -> Result<Self>
pub fn load() -> Result<Self>
Load configuration from the default config file location.
If the config file doesn’t exist, returns a default (empty) configuration. If the file exists but is malformed, returns an error.
§Errors
Returns an error if:
- The config file exists but cannot be read
- The config file exists but contains invalid TOML or unexpected fields
Trait Implementations§
Source§impl Debug for FileConfig
impl Debug for FileConfig
Source§impl Default for FileConfig
impl Default for FileConfig
Source§fn default() -> FileConfig
fn default() -> FileConfig
Source§impl<'de> Deserialize<'de> for FileConfig
impl<'de> Deserialize<'de> for FileConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for FileConfig
impl RefUnwindSafe for FileConfig
impl Send for FileConfig
impl Sync for FileConfig
impl Unpin for FileConfig
impl UnsafeUnpin for FileConfig
impl UnwindSafe for FileConfig
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more