[−][src]Struct publicsuffix::Domain
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 Eq for Domain
[src]
impl Clone for Domain
[src][+]
impl PartialEq<Domain> for Domain
[src][+]
impl Hash for Domain
[src][+]
impl Debug for Domain
[src][+]
impl Display for Domain
[src][+]
Auto Trait Implementations
impl Send for Domain
impl Unpin for Domain
impl Sync for Domain
impl UnwindSafe for Domain
impl RefUnwindSafe for Domain
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src][+]
T: Clone,
impl<T, U> Into<U> for T where
U: From<T>,
[src][+]
U: From<T>,
impl<T> From<T> for T
[src][+]
impl<T> ToString for T where
T: Display + ?Sized,
[src][+]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src][+]
U: Into<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src][+]
U: TryFrom<T>,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src][+]
T: 'static + ?Sized,