Struct publicsuffix::Domain
[−]
[src]
pub struct Domain { /* fields omitted */ }
Holds information about a particular domain
This is created by List::parse_domain
.
Methods
impl Domain
[src]
fn has_valid_syntax(domain: &str) -> bool
Check if a domain has valid syntax
fn root(&self) -> Option<&str>
Gets the root domain portion if any
fn suffix(&self) -> Option<&str>
Gets the suffix if any
fn is_private(&self) -> bool
Whether the domain has a private suffix
fn is_icann(&self) -> bool
Whether the domain has an ICANN suffix
fn has_known_suffix(&self) -> bool
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 Debug for Domain
[src]
impl Clone for Domain
[src]
fn clone(&self) -> Domain
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more