pub struct MatchOptions<'a> {
pub url: Option<&'a str>,
pub budget: Option<Duration>,
pub max_steps: Option<u64>,
}Expand description
What matching needs that a document doesn’t carry. The default has
none of it, so :target and :local-link match nothing.
Fields§
§url: Option<&'a str>The document’s URL, for :target, :target-within and :local-link.
budget: Option<Duration>Give up after this long. Most selectors cost a walk of the tree,
but some cost more on some pages: a descendant combinator over a
very deep tree, :has() of more than one compound. A crawler
matching pages it doesn’t control should set one. Only
SelectorList::try_select_with and
SelectorList::try_matches_with read it; the clock is read every
1,024 compounds matched.
max_steps: Option<u64>Give up after matching this many compounds, which those two read
as they read budget. It needs no clock, so it works where there
is none to read, as on wasm32-unknown-unknown, and gives the same
answer on any machine. A walk of the tree is a compound or so an
element; a few hundred million is seconds of work.
Trait Implementations§
Source§impl<'a> Clone for MatchOptions<'a>
impl<'a> Clone for MatchOptions<'a>
Source§fn clone(&self) -> MatchOptions<'a>
fn clone(&self) -> MatchOptions<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more