css_select/parser
Types
Error returned when parsing fails.
pub type ParseError {
ParseError(String)
}
Constructors
-
ParseError(String)
Values
pub fn new() -> Parser
Create a new parser instance with pre-built splitters.
Use this when parsing multiple selectors to avoid the overhead of creating splitters on each call.
let parser = parser.new()
parser.parse_simple_selector_with_parser(parser, "div#foo")
parser.parse_simple_selector_with_parser(parser, ".bar")
pub fn parse(
parser: Parser,
input: String,
) -> Result(selector.Selector, ParseError)
Parse a CSS selector string using a pre-created Parser.
This avoids the overhead of creating splitters on each call.
Create a Parser once with new() and reuse it for all parsing.