pub struct Domain { /* private fields */ }
Expand description
A basic data type for housing Internet domains.
Implementations§
Source§impl Domain
impl Domain
Sourcepub fn from(data: &str) -> Option<Domain>
pub fn from(data: &str) -> Option<Domain>
Creates a Domain from an existing string. If it contains illegal characters, it will return None. All capital letters will have their case squashed. This type exists to ensure that valid domains are used across the library
Sourcepub fn parent(&self) -> Option<Domain>
pub fn parent(&self) -> Option<Domain>
Returns the parent domain unless doing so would return a top-level domain, i.e. ‘.com’, in which case it returns None.
Trait Implementations§
Source§impl PartialOrd for Domain
impl PartialOrd 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