rswappalyzer_engine/core/
cached_rule.rs1use rustc_hash::FxHashMap;
2use serde::{Deserialize, Serialize};
3
4use crate::{MatchCondition, MatchScope, Pattern, TechBasicInfo};
5
6
7
8#[derive(Debug, Clone, Serialize, Deserialize)]
10pub struct CachedScopeRule {
11 pub condition: MatchCondition,
12 pub list_patterns: Option<Vec<Pattern>>,
14 pub keyed_patterns: Option<FxHashMap<String, Vec<Pattern>>>,
16}
17
18#[derive(Debug, Clone, Serialize, Deserialize)]
20pub struct CachedTechRule {
21 pub basic: TechBasicInfo, pub rules: FxHashMap<MatchScope, CachedScopeRule>,
24}
25
26#[derive(Debug, Clone, Serialize, Deserialize)]
28pub struct CachedRuleEntry {
29 pub scope: MatchScope,
31 pub condition: MatchCondition,
33 pub patterns: Vec<Pattern>,
35}