Struct adblock::lists::ParseOptions
source · pub struct ParseOptions {
pub format: FilterFormat,
pub rule_types: RuleTypes,
pub permissions: PermissionMask,
}
Expand description
Options for tweaking how a filter or list of filters is interpreted when parsing. It’s
recommended to use struct update syntax with a default()
“rest” value; adding new fields to
this struct will not be considered a breaking change.
let parse_options = ParseOptions {
format: FilterFormat::Hosts,
..ParseOptions::default()
};
Fields§
§format: FilterFormat
Assume filters are in the given format when parsing. Defaults to FilterFormat::Standard
.
rule_types: RuleTypes
Specifies rule types to keep during parsing. Defaults to RuleTypes::All
. This can be used
to reduce the memory impact of engines that will only be used for cosmetic filtering or
network filtering, but not both. It can also be useful for iOS and macOS when exporting to
content-blocking syntax, as these platforms limit the number of content blocking rules that
can be loaded.
permissions: PermissionMask
Specifies permissions to use when parsing a given filter list. See PermissionMask
for
more info.
Trait Implementations§
source§impl Clone for ParseOptions
impl Clone for ParseOptions
source§fn clone(&self) -> ParseOptions
fn clone(&self) -> ParseOptions
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more