42 releases (22 breaking)

Uses old Rust 2015

0.23.0 Apr 29, 2021
0.22.0 Dec 19, 2019
0.21.0 Dec 31, 2018
0.20.0 Aug 23, 2018
0.0.1 Dec 29, 2014

#296 in Web programming

Download history 13766/week @ 2021-08-17 13946/week @ 2021-08-24 14076/week @ 2021-08-31 15065/week @ 2021-09-07 13703/week @ 2021-09-14 15626/week @ 2021-09-21 14434/week @ 2021-09-28 16104/week @ 2021-10-05 14583/week @ 2021-10-12 14534/week @ 2021-10-19 13968/week @ 2021-10-26 15947/week @ 2021-11-02 14883/week @ 2021-11-09 14288/week @ 2021-11-16 14242/week @ 2021-11-23 16512/week @ 2021-11-30

62,660 downloads per month
Used in 251 crates (13 directly)

MPL-2.0 license

245KB
5K SLoC

rust-selectors

CSS Selectors library for Rust. Includes parsing and serialization of selectors, as well as matching against a generic tree of elements. Pseudo-elements and most pseudo-classes are generic as well.

Warning: breaking changes are made to this library fairly frequently (13 times in 2016, for example). However you can use this crate without updating it that often, old versions stay available on crates.io and Cargo will only automatically update to versions that are numbered as compatible.

To see how to use this library with your own tree representation, see Kuchiki’s src/select.rs. (Note however that Kuchiki is not always up to date with the latest rust-selectors version, so that code may need to be tweaked.) If you don’t already have a tree data structure, consider using Kuchiki itself.

Dependencies

~1.5–2MB
~44K SLoC