Struct publicsuffix::Domain
source · pub struct Domain { /* private fields */ }
Expand description
Holds information about a particular domain
This is created by List::parse_domain
.
Implementations§
source§impl Domain
impl Domain
sourcepub fn has_valid_syntax(domain: &str) -> bool
pub fn has_valid_syntax(domain: &str) -> bool
Check if a domain has valid syntax
sourcepub fn is_private(&self) -> bool
pub fn is_private(&self) -> bool
Whether the domain has a private suffix
sourcepub fn has_known_suffix(&self) -> bool
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§
source§impl PartialEq for Domain
impl PartialEq for Domain
impl Eq for Domain
impl StructuralPartialEq for Domain
Auto Trait Implementations§
impl Freeze for Domain
impl RefUnwindSafe for Domain
impl Send for Domain
impl Sync for Domain
impl Unpin for Domain
impl UnwindSafe for Domain
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)