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.0const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for DNSNameRef<'_>
impl Debug for DNSNameRef<'_>
sourceimpl From<DNSNameRef<'_>> for DNSName
impl From<DNSNameRef<'_>> for DNSName
sourcefn from(dns_name: DNSNameRef<'_>) -> Self
fn from(dns_name: DNSNameRef<'_>) -> Self
Converts to this type from the input type.
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
Converts to this type from the input type.
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
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstablefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> ToOwned for Twhere
T: Clone,
impl<T> ToOwned for Twhere
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
fn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
Uses borrowed data to replace owned data, usually by cloning. Read more