Closed FauxFaux closed 3 years ago
The owner of this library seems to also have worked on github.com/addr-rs/addr, which looks similar but abandoned?
It's not abandoned. I'm just preoccupied with other things right now. addr
is the next iteration of this library.
Which should we be using?
That depends on your use case and the trade-offs you are willing to make.
Personally I was interested in just the domain parsing
In that case I recommend using just using the psl crate. Currently it has horrible compile times and it assumes that the domain name is in lowercase already but in return, you get:-
If you only need to support a few TLDs you can reduce compile times a lot by defining the PSL_TLD
or PSL_TLDS
environment variable before building.
The README now mentions addr
and psl
crates but I intent to improve the documentation at some point. In a nutshell, as of v2, psl
and publicsuffix
crates are just implementations of the public suffix list. They don't try to validate or parse domain names, dns names or email addresses in any way. That's what addr
is for.
The difference between psl
and publicsuffix
is that with psl
, the list itself is compiled down to Rust code for optimal performance but because of that, it can't be updated at runtime. That is where publicsuffix
comes in. It's dynamic and can be updated at runtime. That also enables it to optionally support anycase
domain matching.
The owner of this library seems to also have worked on github.com/addr-rs/addr, which looks similar but abandoned?
Which should we be using?
Personally I was interested in just the domain parsing, so tried to use
addr
, but noticed it looking outdated. I guess the intention is to use this crate, but to disable the "remote-list" feature?