[][src]Struct https_everywhere_lib_wasm::RuleSets

pub struct RuleSets(_);

A newtype for rulesets, wrapping all the JS functionality

Methods

impl RuleSets[src]

pub fn new() -> RuleSets[src]

Returns a new JsRulesets struct

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

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

pub fn add_all_from_js_array(
    &mut self,
    array: &Array,
    enable_mixed_rulesets: &Boolean,
    rule_active_states: &JsValue,
    scope: &JsValue
)

Construct and add new rulesets given a JS array of values

Arguments

  • array - A JS Array object of rulesets
  • enable_mixed_rulesets - A JS Boolean indicating whether rulesets which trigger mixed content blocking should be enabled
  • rule_active_states - A JS object which lets us know whether rulesets have been disabled or enabled
  • scope - An optional JS string which indicates the scope of the current batch of rulesets being added (see the ruleset update channels documentation)

pub fn print_targets(&self)[src]

Print the entire RuleSets struct

pub fn remove_ruleset(&mut self, ruleset_jsval: &JsValue)[src]

Remove a RuleSet from the RuleSets struct

pub fn potentially_applicable(&self, host: &JsValue) -> JsValue[src]

Return a JS set of rulesets that apply to the given host

Arguments

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

Trait Implementations

impl From<RuleSets> for JsValue[src]

impl Debug for RuleSets[src]

impl WasmDescribe for RuleSets[src]

impl IntoWasmAbi for RuleSets[src]

type Abi = u32

The wasm ABI type that this converts into when crossing the ABI boundary. Read more

impl FromWasmAbi for RuleSets[src]

type Abi = u32

The wasm ABI type that this converts from when coming back out from the ABI boundary. Read more

impl RefFromWasmAbi for RuleSets[src]

type Abi = u32

The wasm ABI type references to Self are recovered from.

type Anchor = Ref<'static, RuleSets>

The type that holds the reference to Self for the duration of the invocation of the function that has an &Self parameter. This is required to ensure that the lifetimes don't persist beyond one function call, and so that they remain anonymous. Read more

impl OptionIntoWasmAbi for RuleSets[src]

impl OptionFromWasmAbi for RuleSets[src]

impl RefMutFromWasmAbi for RuleSets[src]

type Abi = u32

Same as RefFromWasmAbi::Abi

type Anchor = RefMut<'static, RuleSets>

Same as RefFromWasmAbi::Anchor

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]

impl<T> ReturnWasmAbi for T where
    T: IntoWasmAbi
[src]

type Abi = <T as IntoWasmAbi>::Abi

Same as IntoWasmAbi::Abi