pub struct RuleSets(pub BTreeMap<String, Vec<Rc<RuleSet>>>);Expand description
RuleSets consists of a tuple btreemap of rulesets, keyed by some target FQDN
Tuple Fields§
§0: BTreeMap<String, Vec<Rc<RuleSet>>>Implementations§
Source§impl RuleSets
impl RuleSets
Sourcepub fn count_targets(&self) -> usize
pub fn count_targets(&self) -> usize
Returns the number of targets in the current RuleSets struct as a usize
Sourcepub fn add_all_from_json_string(
&mut self,
json_string: &String,
enable_mixed_rulesets: &bool,
ruleset_active_states: &HashMap<String, bool>,
scope: &Option<String>,
)
pub fn add_all_from_json_string( &mut self, json_string: &String, enable_mixed_rulesets: &bool, ruleset_active_states: &HashMap<String, bool>, scope: &Option<String>, )
Construct and add new rulesets given a json string of values
§Arguments
json_string- A json string representing the rulesets to addenable_mixed_rulesets- A bool indicating whether rulesets which trigger mixed content blocking should be enabledrule_active_states- A HashMap which lets us know whether rulesets have been disabled or enabledscope- An optional string which indicates the scope of the current batch of rulesets being added (see the ruleset update channels documentation)
pub fn add_all_from_serde_value( &mut self, rulesets: Value, enable_mixed_rulesets: &bool, ruleset_active_states: &HashMap<String, bool>, scope: &Option<String>, )
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RuleSets
impl RefUnwindSafe for RuleSets
impl !Send for RuleSets
impl !Sync for RuleSets
impl Unpin for RuleSets
impl UnwindSafe for RuleSets
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
Mutably borrows from an owned value. Read more