[][src]Struct https_everywhere_lib_core::RuleSets

pub struct RuleSets(pub BTreeMap<String, Vec<Rc<RuleSet>>>);

RuleSets consists of a tuple btreemap of rulesets, keyed by some target FQDN

Methods

impl RuleSets[src]

pub fn new() -> RuleSets[src]

Returns a new rulesets struct

pub fn count_targets(&self) -> usize[src]

Returns the number of targets in the current RuleSets struct as a usize

pub fn clear(&mut self)[src]

Clears the ruleset btreemap of all values

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>
)
[src]

Construct and add new rulesets given a json string of values

Arguments

  • json_string - A json string representing the rulesets to add
  • enable_mixed_rulesets - A bool indicating whether rulesets which trigger mixed content blocking should be enabled
  • rule_active_states - A HashMap which lets us know whether rulesets have been disabled or enabled
  • scope - 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>
)
[src]

pub fn potentially_applicable(&self, host: &String) -> Vec<Rc<RuleSet>>[src]

Return a vector of rulesets that apply to the given host

Arguments

  • host - A string which indicates the host to search for potentially applicable rulesets

Trait Implementations

impl Debug for RuleSets[src]

Auto Trait Implementations

impl Unpin for RuleSets

impl !Sync for RuleSets

impl !Send for RuleSets

impl !UnwindSafe for RuleSets

impl !RefUnwindSafe for RuleSets

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]