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]
impl Domain
pub fn has_valid_syntax(domain: &str) -> bool
[src]
pub fn has_valid_syntax(domain: &str) -> bool
Check if a domain has valid syntax
pub fn root(&self) -> Option<&str>
[src]
pub fn root(&self) -> Option<&str>
Gets the root domain portion if any
pub fn suffix(&self) -> Option<&str>
[src]
pub fn suffix(&self) -> Option<&str>
Gets the suffix if any
pub fn is_private(&self) -> bool
[src]
pub fn is_private(&self) -> bool
Whether the domain has a private suffix
pub fn is_icann(&self) -> bool
[src]
pub fn is_icann(&self) -> bool
Whether the domain has an ICANN suffix
pub fn has_known_suffix(&self) -> bool
[src]
pub 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 Debug for Domain
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Clone for Domain
[src]
impl Clone for Domain
fn clone(&self) -> Domain
[src]
fn clone(&self) -> Domain
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl PartialEq for Domain
[src]
impl PartialEq for Domain
fn eq(&self, other: &Domain) -> bool
[src]
fn eq(&self, other: &Domain) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Domain) -> bool
[src]
fn ne(&self, other: &Domain) -> bool
This method tests for !=
.
impl Eq for Domain
[src]
impl Eq for Domain
impl Hash for Domain
[src]
impl Hash for Domain
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Display for Domain
[src]
impl Display for Domain