[−][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]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
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,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
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>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
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,