sbom_tools/diff/
engine_config.rs1use crate::matching::CrossEcosystemConfig;
4
5#[derive(Debug, Clone)]
7pub struct LargeSbomConfig {
8 pub lsh_threshold: usize,
10 pub cross_ecosystem: CrossEcosystemConfig,
12 pub max_candidates: usize,
14}
15
16impl Default for LargeSbomConfig {
17 fn default() -> Self {
18 Self {
19 lsh_threshold: 500,
20 cross_ecosystem: CrossEcosystemConfig::default(),
21 max_candidates: 100,
22 }
23 }
24}
25
26impl LargeSbomConfig {
27 #[must_use]
29 pub const fn enable_cross_ecosystem(&self) -> bool {
30 self.cross_ecosystem.enabled
31 }
32
33 #[must_use]
35 pub fn aggressive() -> Self {
36 Self {
37 lsh_threshold: 300,
38 cross_ecosystem: CrossEcosystemConfig::default(),
39 max_candidates: 50,
40 }
41 }
42
43 #[must_use]
45 pub fn conservative() -> Self {
46 Self {
47 lsh_threshold: 1000,
48 cross_ecosystem: CrossEcosystemConfig::disabled(),
49 max_candidates: 150,
50 }
51 }
52}