pub struct DnsNameRef<'a>(/* private fields */);
Expand description
A reference to a DNS Name suitable for use in the TLS Server Name Indication (SNI) extension and/or for use as the reference hostname for which to verify a certificate.
A DnsNameRef
is guaranteed to be syntactically valid. The validity rules
are specified in RFC 5280 Section 7.2, except that underscores are also
allowed.
Eq
, PartialEq
, etc. are not implemented because name comparison
frequently should be done case-insensitively and/or with other caveats that
depend on the specific circumstances in which the comparison is done.
Implementations§
Source§impl<'a> DnsNameRef<'a>
impl<'a> DnsNameRef<'a>
Sourcepub fn try_from_ascii(dns_name: &'a [u8]) -> Result<Self, InvalidDnsNameError>
pub fn try_from_ascii(dns_name: &'a [u8]) -> Result<Self, InvalidDnsNameError>
Constructs a DnsNameRef
from the given input if the input is a
syntactically-valid DNS name.
Sourcepub fn try_from_ascii_str(
dns_name: &'a str,
) -> Result<Self, InvalidDnsNameError>
pub fn try_from_ascii_str( dns_name: &'a str, ) -> Result<Self, InvalidDnsNameError>
Constructs a DnsNameRef
from the given input if the input is a
syntactically-valid DNS name.
Trait Implementations§
Source§impl AsRef<[u8]> for DnsNameRef<'_>
impl AsRef<[u8]> for DnsNameRef<'_>
Source§impl<'a> Clone for DnsNameRef<'a>
impl<'a> Clone for DnsNameRef<'a>
Source§fn clone(&self) -> DnsNameRef<'a>
fn clone(&self) -> DnsNameRef<'a>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for DnsNameRef<'_>
Requires the alloc
feature.
impl Debug for DnsNameRef<'_>
Requires the alloc
feature.
Source§impl From<DnsNameRef<'_>> for DnsName
Requires the alloc
feature.
impl From<DnsNameRef<'_>> for DnsName
Requires the alloc
feature.