pub struct DnsName<'a> { /* private fields */ }Expand description
A DNS name.
Implementations§
Source§impl<'a> DnsName<'a>
impl<'a> DnsName<'a>
Sourcepub fn new(bytes: &'a [u8]) -> Result<Self, DnsMessageError>
pub fn new(bytes: &'a [u8]) -> Result<Self, DnsMessageError>
Create a new DnsName from a byte slice. The bytes must be in DNS
wire format. The constructor will check if the name is valid.
Sourcepub const unsafe fn new_unchecked(bytes: &'a [u8]) -> Self
pub const unsafe fn new_unchecked(bytes: &'a [u8]) -> Self
Create a new DnsName from a byte slice. The bytes must be in DNS
wire format. The constructor will not check if the name is valid, hence
the unsafe. Using this function is unsafe cause it can lead to an
invalid DNS message.
Sourcepub fn iter(&self) -> NameIterator<'a> ⓘ
pub fn iter(&self) -> NameIterator<'a> ⓘ
Return an iterator over the parts of the name.
Trait Implementations§
impl<'a> Copy for DnsName<'a>
Auto Trait Implementations§
impl<'a> Freeze for DnsName<'a>
impl<'a> RefUnwindSafe for DnsName<'a>
impl<'a> Send for DnsName<'a>
impl<'a> Sync for DnsName<'a>
impl<'a> Unpin for DnsName<'a>
impl<'a> UnwindSafe for DnsName<'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