pub struct ListProvider<T: Table>(/* private fields */);Expand description
ListProvider is a generic struct that provides results based on a standard eTLD list generated by the included Golang program.
To override the list included with this crate, disable the default_provider crate feature
and create a ListProvider with your own implmentation of the Table trait, generated from your own
custom list.
Implementations§
Source§impl<T: Table> ListProvider<T>
impl<T: Table> ListProvider<T>
Sourcepub fn public_suffix<'a>(&self, domain: &'a str) -> &'a str
pub fn public_suffix<'a>(&self, domain: &'a str) -> &'a str
Returns the public suffix of the domain using a copy of the
publicsuffix.org database compiled into the library (if using
the default_provider crate feature) or your own impl of Table.
Note: The input string must be punycode (ASCII) and the result will be punycode (ASCII). The implementation of this function assumes each character is encoded in one byte; this assumption is inherent in the design of the generated table.
It is recommended to use idna::domain_to_ascii to convert your inputs to ASCII punycode before passing to this method.
Sourcepub fn is_effective_tld(&self, domain: &str) -> bool
pub fn is_effective_tld(&self, domain: &str) -> bool
Returns true if domain is an effective top level domain.