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§
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)