#tld #gtld #cctld #domain #psl

psl-lexer

A lexer for Mozilla’s Public Suffix List

7 releases

0.3.1 Mar 1, 2021
0.3.0 Feb 28, 2021
0.2.3 Feb 27, 2021
0.2.0 Jul 18, 2018
0.1.0 Jul 9, 2018

#6 in #gtld

Download history 1044/week @ 2020-12-30 1007/week @ 2021-01-06 921/week @ 2021-01-13 1241/week @ 2021-01-20 1565/week @ 2021-01-27 1147/week @ 2021-02-03 1050/week @ 2021-02-10 1044/week @ 2021-02-17 1245/week @ 2021-02-24 945/week @ 2021-03-03 903/week @ 2021-03-10 828/week @ 2021-03-17 671/week @ 2021-03-24 825/week @ 2021-03-31 664/week @ 2021-04-07 744/week @ 2021-04-14

4,879 downloads per month
Used in psl-codegen

MIT/Apache

11KB
252 lines

PSL Lexer

Parse the Public Suffix List into easy to consume rules


lib.rs:

Public Suffix List Lexer

All this library does is provide methods for fetching and parsing Mozilla's Public Suffix List. You may be interested in higher level libraries like psl.

Examples

use psl_lexer::List;
# use psl_lexer::Result;

# fn examples() -> Result<()> {
// Fetch the list from the official URL,
# #[cfg(feature = "remote_list")]
let list = List::fetch()?;

// from your own URL
# #[cfg(feature = "remote_list")]
let list = List::from_url("https://example.com/path/to/public_suffix_list.dat")?;

// or from a local file.
let list = List::from_path("/path/to/public_suffix_list.dat")?;
# Ok(())
# }
# fn main() {}

Dependencies

~2.1–2.9MB
~77K SLoC