Struct webpki::DnsNameRef
source · [−]pub struct DnsNameRef<'a>(_);
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
sourceimpl<'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
sourceimpl<'a> Clone for DnsNameRef<'a>
impl<'a> Clone for DnsNameRef<'a>
sourcefn clone(&self) -> DnsNameRef<'a>
fn clone(&self) -> DnsNameRef<'a>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for DnsNameRef<'_>
impl Debug for DnsNameRef<'_>
Requires the alloc
feature.
sourceimpl From<DnsNameRef<'_>> for DnsName
impl From<DnsNameRef<'_>> for DnsName
Requires the alloc
feature.
sourcefn from(dns_name: DnsNameRef<'_>) -> Self
fn from(dns_name: DnsNameRef<'_>) -> Self
Performs the conversion.
sourceimpl<'a> From<DnsNameRef<'a>> for &'a str
impl<'a> From<DnsNameRef<'a>> for &'a str
sourcefn from(DnsNameRef: DnsNameRef<'a>) -> Self
fn from(DnsNameRef: DnsNameRef<'a>) -> Self
Performs the conversion.
impl<'a> Copy for DnsNameRef<'a>
Auto Trait Implementations
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more