Struct webpki::DnsNameRef
source · pub struct DnsNameRef<'a>(pub(crate) &'a [u8]);
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. DnsNameRef
s do not include wildcard labels.
Tuple Fields§
§0: &'a [u8]
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<str> for DnsNameRef<'_>
impl AsRef<str> 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>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for DnsNameRef<'_>
impl Debug for DnsNameRef<'_>
source§impl<'a> From<DnsNameRef<'a>> for &'a str
impl<'a> From<DnsNameRef<'a>> for &'a str
source§fn from(DnsNameRef: DnsNameRef<'a>) -> Self
fn from(DnsNameRef: DnsNameRef<'a>) -> Self
Converts to this type from the input type.
source§impl<'a> From<DnsNameRef<'a>> for SubjectNameRef<'a>
impl<'a> From<DnsNameRef<'a>> for SubjectNameRef<'a>
source§fn from(dns_name: DnsNameRef<'a>) -> SubjectNameRef<'_>
fn from(dns_name: DnsNameRef<'a>) -> SubjectNameRef<'_>
Converts to this type from the input type.
source§impl<'a> Hash for DnsNameRef<'a>
impl<'a> Hash for DnsNameRef<'a>
source§impl<'a> PartialEq for DnsNameRef<'a>
impl<'a> PartialEq for DnsNameRef<'a>
source§fn eq(&self, other: &DnsNameRef<'a>) -> bool
fn eq(&self, other: &DnsNameRef<'a>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl<'a> Copy for DnsNameRef<'a>
impl<'a> Eq for DnsNameRef<'a>
impl<'a> StructuralPartialEq for DnsNameRef<'a>
Auto Trait Implementations§
impl<'a> Freeze for DnsNameRef<'a>
impl<'a> RefUnwindSafe for DnsNameRef<'a>
impl<'a> Send for DnsNameRef<'a>
impl<'a> Sync for DnsNameRef<'a>
impl<'a> Unpin for DnsNameRef<'a>
impl<'a> UnwindSafe for DnsNameRef<'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