Struct psl_lexer::List [−][src]
Stores the public suffix list
You can use the methods, fetch
, from_url
or from_path
to build the list.
If you are using this in a long running server it's recommended you use either
fetch
or from_url
to download updates at least once a week.
Fields
rules: HashMap<String, Vec<Suffix>>
Methods
impl List
[src]
impl List
pub fn from_url<U: IntoUrl>(url: U) -> Result<List>
[src]
pub fn from_url<U: IntoUrl>(url: U) -> Result<List>
Pull the list from a URL
pub fn from_path<P: AsRef<Path>>(path: P) -> Result<List>
[src]
pub fn from_path<P: AsRef<Path>>(path: P) -> Result<List>
Fetch the list from a local file
pub fn from_reader<R: Read>(reader: R) -> Result<List>
[src]
pub fn from_reader<R: Read>(reader: R) -> Result<List>
Build the list from the result of anything that implements std::io::Read
If you don't already have your list on the filesystem but want to use your own library to fetch the list you can use this method so you don't have to save it first.
pub fn from_str(string: &str) -> Result<List>
[src]
pub fn from_str(string: &str) -> Result<List>
Build the list from a str
The list doesn't always have to come from a file. You can maintain your own list, say in a DBMS. You can then pull it at runtime and build the list from the resulting str.
pub fn fetch() -> Result<List>
[src]
pub fn fetch() -> Result<List>
Pull the list from the official URL
pub fn icann(&self) -> Vec<&str>
[src]
pub fn icann(&self) -> Vec<&str>
Gets a list of all ICANN domain suffices
pub fn private(&self) -> Vec<&str>
[src]
pub fn private(&self) -> Vec<&str>
Gets a list of all private domain suffices
pub fn all(&self) -> Vec<&str>
[src]
pub fn all(&self) -> Vec<&str>
Gets a list of all domain suffices