Struct psl_lexer::List[][src]

pub struct List {
    pub rules: IndexMap<String, Vec<Suffix>>,
}

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: IndexMap<String, Vec<Suffix>>

Implementations

impl List[src]

pub fn from_url<U: IntoUrl>(url: U) -> Result<List>[src]

Pull the list from a URL

pub fn from_path<P: AsRef<Path>>(path: P) -> Result<List>[src]

Fetch the list from a local file

pub fn from_reader<R: Read>(reader: R) -> Result<List>[src]

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 fetch() -> Result<List>[src]

Pull the list from the official URL

pub fn icann(&self) -> Vec<&str>[src]

Gets a list of all ICANN domain suffices

pub fn private(&self) -> Vec<&str>[src]

Gets a list of all private domain suffices

pub fn all(&self) -> Vec<&str>[src]

Gets a list of all domain suffices

Trait Implementations

impl Debug for List[src]

impl FromStr for List[src]

type Err = Error

The associated error which can be returned from parsing.

Auto Trait Implementations

impl RefUnwindSafe for List

impl Send for List

impl Sync for List

impl Unpin for List

impl UnwindSafe for List

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.