README

bobzhang/html_parser/selector does not have a README file

#
SelectorLimits

pub(all) struct SelectorLimits {
max_match_depth : Int
max_length : Int
max_list_items : Int
max_compound_simple_selectors : Int
max_complex_selector_parts : Int
max_parse_depth : Int
max_match_steps : Int
max_match_bytes : Int
} derive(Eq,
Debug
)

Resource limits used while parsing and matching CSS selectors.

Limits are defensive bounds for selector length, nesting, list size, and match cost. Negative match budgets are treated as exhausted.

#
SelectorLimits::new

fn SelectorLimits::new(max_match_depth? : Int, max_length? : Int, max_list_items? : Int, max_compound_simple_selectors? : Int, max_complex_selector_parts? : Int, max_parse_depth? : Int, max_match_steps? : Int, max_match_bytes? : Int) -> SelectorLimits

Construct selector limits, using conservative defaults for omitted values.

#
is_valid

fn is_valid(selector : StringView) -> Bool

Return whether a CSS selector parses as a non-empty selector list.

#
matches

fn matches(node :
Node
, selector : StringView) -> Bool

Return whether node itself matches a CSS selector.

#
matches_with_limits

fn matches_with_limits(node :
Node
, selector : StringView, limits : SelectorLimits) -> Bool raise
HtmlError

Test whether node matches a selector under explicit resource limits.

The selector is validated against limits before matching. Invalid selectors return false; selectors that exceed configured depth, length, or match-budget limits raise HtmlError.

#
query

Return all descendants of root that match a CSS selector.

#
query_one

fn query_one(root :
Node
, selector : StringView) ->
Node
?

Return the first descendant of root that matches a CSS selector.

Powered by MoonBit

Site sourceReport issuePackagesBuild queueSkillsStatistics

© 2026 mooncakes.io