pub struct CNAME<'a>(pub Name<'a>);
Expand description
Canonical name for an alias, RFC 1035
Tuple Fields§
§0: Name<'a>
Implementations§
Methods from Deref<Target = Name<'a>>§
sourcepub fn is_link_local(&self) -> bool
pub fn is_link_local(&self) -> bool
Verify if name ends with .local.
sourcepub fn is_subdomain_of(&self, other: &Name<'_>) -> bool
pub fn is_subdomain_of(&self, other: &Name<'_>) -> bool
Returns true if self is a subdomain of other
sourcepub fn without(&self, domain: &Name<'_>) -> Option<Name<'_>>
pub fn without(&self, domain: &Name<'_>) -> Option<Name<'_>>
Returns the subdomain part of self, based on domain
.
If self is not a subdomain of domain
, returns None
Example:
let name = Name::new_unchecked("sub.domain.local");
let domain = Name::new_unchecked("domain.local");
assert!(domain.without(&name).is_none());
let sub = name.without(&domain).unwrap();
assert_eq!(sub.to_string(), "sub")
sourcepub fn get_labels(&self) -> &[Label<'_>]
pub fn get_labels(&self) -> &[Label<'_>]
Get the labels that compose this name
Trait Implementations§
impl<'a> Eq for CNAME<'a>
impl<'a> StructuralPartialEq for CNAME<'a>
Auto Trait Implementations§
impl<'a> Freeze for CNAME<'a>
impl<'a> RefUnwindSafe for CNAME<'a>
impl<'a> Send for CNAME<'a>
impl<'a> Sync for CNAME<'a>
impl<'a> Unpin for CNAME<'a>
impl<'a> UnwindSafe for CNAME<'a>
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
)