rswappalyzer_engine/core/
rule.rs1use rustc_hash::FxHashMap;
2use crate::CategoryRule;
3
4use super::basic_info::{CategoryEntry, TechBasicInfo};
5use super::enums::MatchScope;
6use super::pattern::MatchRuleSet;
7
8#[derive(Debug, Clone, Default, PartialEq)]
10pub struct ParsedTechRule {
11 pub basic: TechBasicInfo,
12 pub match_rules: FxHashMap<MatchScope, MatchRuleSet>,
13}
14
15impl From<&ParsedTechRule> for TechBasicInfo {
16 fn from(rule: &ParsedTechRule) -> Self {
17 rule.basic.clone()
18 }
19}
20
21#[derive(Debug, Clone, Default, PartialEq)]
23pub struct RuleLibrary {
24 pub core_tech_map: FxHashMap<String, ParsedTechRule>,
26 pub category_rules: FxHashMap<u32, CategoryRule>,
28}
29
30pub type CategoryJsonRoot = FxHashMap<String, CategoryEntry>;