pub fn parse_css_path(input: &str) -> Result<CssPath, CssPathParseError<'_>>Expand description
Parses a CSS path from a string (only the path,.no commas allowed)
assert_eq!(
parse_css_path("* div #my_id > .class:nth-child(2)"),
Ok(CssPath {
selectors: vec![
Global,
Type(Div),
Children,
Id("my_id".to_string().into()),
DirectChildren,
Class("class".to_string().into()),
PseudoSelector(NthChild(Number(2))),
]
.into()
})
);ยงErrors
Returns an error if input is not a valid CSS css-path value.