pub struct AppConfig {
pub matching: MatchingConfig,
pub output: OutputConfig,
pub filtering: FilterConfig,
pub behavior: BehaviorConfig,
pub graph_diff: GraphAwareDiffConfig,
pub rules: MatchingRulesPathConfig,
pub ecosystem_rules: EcosystemRulesConfig,
pub tui: TuiConfig,
pub enrichment: Option<EnrichmentConfig>,
}Expand description
Unified application configuration that can be loaded from CLI args or config files.
This is the top-level configuration struct that aggregates all configuration options. It can be constructed from CLI arguments, config files, or both (with CLI overriding file settings).
Fields§
§matching: MatchingConfigMatching configuration (thresholds, presets)
output: OutputConfigOutput configuration (format, file, colors)
filtering: FilterConfigFiltering options
behavior: BehaviorConfigBehavior flags
graph_diff: GraphAwareDiffConfigGraph-aware diffing configuration
rules: MatchingRulesPathConfigCustom matching rules configuration
ecosystem_rules: EcosystemRulesConfigEcosystem-specific rules configuration
tui: TuiConfigTUI-specific configuration
enrichment: Option<EnrichmentConfig>Enrichment configuration (OSV, etc.)
Implementations§
Source§impl AppConfig
impl AppConfig
Sourcepub fn from_preset(preset: ConfigPreset) -> Self
pub fn from_preset(preset: ConfigPreset) -> Self
Create an AppConfig from a named preset.
Sourcepub fn security_preset() -> Self
pub fn security_preset() -> Self
Security-focused preset.
- Strict matching to avoid false negatives
- Fail on new vulnerabilities
- Enable typosquat detection
Sourcepub fn ci_cd_preset() -> Self
pub fn ci_cd_preset() -> Self
CI/CD pipeline preset.
- JSON output for machine parsing
- Fail on any changes
- Quiet mode to reduce noise
Sourcepub fn permissive_preset() -> Self
pub fn permissive_preset() -> Self
Permissive preset for messy SBOMs.
- Low matching threshold
- Include unchanged for full picture
- No fail modes
Sourcepub fn strict_preset() -> Self
pub fn strict_preset() -> Self
Strict preset for well-maintained SBOMs.
- High matching threshold
- Graph-aware diffing
- Detailed explanations available
Source§impl AppConfig
impl AppConfig
Sourcepub fn merge(&mut self, other: &Self)
pub fn merge(&mut self, other: &Self)
Merge another config into this one, with other taking precedence.
This is useful for layering CLI args over file config. A field in
other overrides the corresponding field in self only when it
differs from the built-in default — a default-valued field is treated
as “unset” and leaves self untouched. The sentinel is read from
Self::default() rather than an inlined literal so it can never drift
away from the actual default.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for AppConfig
impl<'de> Deserialize<'de> for AppConfig
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>,
Source§impl JsonSchema for AppConfig
impl JsonSchema for AppConfig
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreAuto Trait Implementations§
impl Freeze for AppConfig
impl RefUnwindSafe for AppConfig
impl Send for AppConfig
impl Sync for AppConfig
impl Unpin for AppConfig
impl UnsafeUnpin for AppConfig
impl UnwindSafe for AppConfig
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<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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