feat(config): add get_rule function to retrieve existing rules

- implement get_rule function to fetch rule by id
This commit is contained in:
Jeremiah Russell
2025-10-09 08:13:30 +01:00
committed by Jeremiah Russell
parent ee3c43e54d
commit d05f03fc1e

View File

@@ -50,6 +50,11 @@ impl Config {
self self
} }
/// Get the contents of an existing rule
pub fn get_rule(&self, id: usize) -> Option<EolRule> {
self.rules.get(&id.to_string()).cloned()
}
/// Add a new rule to the rule set by setting the retention age /// Add a new rule to the rule set by setting the retention age
pub fn add_rule( pub fn add_rule(
&mut self, &mut self,