[][src]Struct publicsuffix::Domain

pub struct Domain { /* fields omitted */ }

Holds information about a particular domain

This is created by List::parse_domain.

Methods

impl Domain[src]

pub fn has_valid_syntax(domain: &str) -> bool[src]

Check if a domain has valid syntax

pub fn full(&self) -> &str[src]

Get the full domain

pub fn root(&self) -> Option<&str>[src]

Gets the root domain portion if any

pub fn suffix(&self) -> Option<&str>[src]

Gets the suffix if any

pub fn is_private(&self) -> bool[src]

Whether the domain has a private suffix

pub fn is_icann(&self) -> bool[src]

Whether the domain has an ICANN suffix

pub fn has_known_suffix(&self) -> bool[src]

Whether this domain's suffix is in the list

If it is, this is definately a valid domain. If it's not chances are very high that this isn't a valid domain name, however, it might simply be because the suffix is new and it hasn't been added to the list yet.

If you want to validate a domain name, use this as a quick check but fall back to a DNS lookup if it returns false.

Trait Implementations

impl Clone for Domain[src]

impl Eq for Domain[src]

impl PartialEq<Domain> for Domain[src]

impl Display for Domain[src]

impl Debug for Domain[src]

impl Hash for Domain[src]

impl StructuralPartialEq for Domain[src]

impl StructuralEq for Domain[src]

Auto Trait Implementations

impl Send for Domain

impl Sync for Domain

impl Unpin for Domain

impl UnwindSafe for Domain

impl RefUnwindSafe for Domain

Blanket Implementations

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

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[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.

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

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

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