pub struct RuleSets(/* private fields */);Expand description
A newtype for rulesets, wrapping all the JS functionality
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 JsRuleSets struct as a usize
Sourcepub fn add_all_from_js_array(
&mut self,
array: &Array,
enable_mixed_rulesets: &Boolean,
rule_active_states: &JsValue,
scope: &JsValue,
)
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 rulesetsenable_mixed_rulesets- A JS Boolean indicating whether rulesets which trigger mixed content blocking should be enabledrule_active_states- A JS object which lets us know whether rulesets have been disabled or enabledscope- An optional JS string which indicates the scope of the current batch of rulesets being added (see the ruleset update channels documentation)
Sourcepub fn print_targets(&self)
pub fn print_targets(&self)
Print the entire RuleSets struct
Sourcepub fn remove_ruleset(&mut self, ruleset_jsval: &JsValue)
pub fn remove_ruleset(&mut self, ruleset_jsval: &JsValue)
Remove a RuleSet from the RuleSets struct
Sourcepub fn potentially_applicable(&self, host: &JsValue) -> JsValue
pub fn potentially_applicable(&self, host: &JsValue) -> JsValue
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§
Source§impl FromWasmAbi for RuleSets
impl FromWasmAbi for RuleSets
Source§impl IntoWasmAbi for RuleSets
impl IntoWasmAbi for RuleSets
Source§impl LongRefFromWasmAbi for RuleSets
impl LongRefFromWasmAbi for RuleSets
Source§impl OptionFromWasmAbi for RuleSets
impl OptionFromWasmAbi for RuleSets
Source§impl OptionIntoWasmAbi for RuleSets
impl OptionIntoWasmAbi for RuleSets
Source§impl RefFromWasmAbi for RuleSets
impl RefFromWasmAbi for RuleSets
Source§impl RefMutFromWasmAbi for RuleSets
impl RefMutFromWasmAbi for RuleSets
Source§impl TryFromJsValue for RuleSets
impl TryFromJsValue for RuleSets
Source§impl VectorFromWasmAbi for RuleSets
impl VectorFromWasmAbi for RuleSets
Source§impl VectorIntoWasmAbi for RuleSets
impl VectorIntoWasmAbi for RuleSets
impl SupportsConstructor for RuleSets
impl SupportsInstanceProperty for RuleSets
impl SupportsStaticProperty for RuleSets
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
Source§impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
Source§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
Same as
IntoWasmAbi::AbiSource§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
Same as
IntoWasmAbi::into_abi, except that it may throw and never
return in the case of Err.