Struct DnsName

pub struct DnsName<'a>(/* private field */);

A type which encapsulates a string (borrowed or owned) that is a syntactically valid DNS name.

Implementations

impl<'a> DnsName<'a>

fn borrow(&'a self) -> Self

Produce a borrowed DnsName from this owned DnsName.

fn to_lowercase_owned(&self) -> DnsName<'static>

Copy this object to produce an owned DnsName, smashing the case to lowercase in one operation.

fn to_owned(&self) -> DnsName<'static>

Produce an owned DnsName from this (potentially borrowed) DnsName.

const fn try_from_str(s: &str) -> Result<DnsName<'_>, InvalidDnsNameError>

Produces a borrowed DnsName from a borrowed str.

Trait Implementations

impl AsRef<str> for DnsName<'_>

fn as_ref(&self) -> &str

impl TryFrom<String> for DnsName<'static>

type Error = InvalidDnsNameError;
fn try_from(value: String) -> Result<Self, Self::Error>

impl<'a> Clone for DnsName<'a>

fn clone(&self) -> DnsName<'a>

impl<'a> Debug for DnsName<'a>

fn fmt(&self, f: &mut Formatter<'_>) -> Result

impl<'a> Eq for DnsName<'a>

impl<'a> Hash for DnsName<'a>

fn hash<__H: Hasher>(&self, state: &mut __H)

impl<'a> PartialEq for DnsName<'a>

fn eq(&self, other: &DnsName<'a>) -> bool

impl<'a> StructuralPartialEq for DnsName<'a>

impl<'a> TryFrom<&'a [u8]> for DnsName<'a>

type Error = InvalidDnsNameError;
fn try_from(value: &'a [u8]) -> Result<Self, Self::Error>

impl<'a> TryFrom<&'a str> for DnsName<'a>

type Error = InvalidDnsNameError;
fn try_from(value: &'a str) -> Result<Self, Self::Error>

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> UnsafeUnpin for DnsName<'a>

impl<'a> UnwindSafe for DnsName<'a>

Blanket Implementations

impl<T> Any for DnsName<'a> where T: 'static + ?Sized,

fn type_id(&self) -> TypeId

impl<T> Borrow<T> for DnsName<'a> where T: ?Sized,

fn borrow(&self) -> &T

impl<T> BorrowMut<T> for DnsName<'a> where T: ?Sized,

fn borrow_mut(&mut self) -> &mut T

impl<T> CloneToUninit for DnsName<'a> where T: Clone,

unsafe fn clone_to_uninit(&self, dest: *mut u8)

impl<T> From<T> for DnsName<'a>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> ToOwned for DnsName<'a> where T: Clone,

type Owned = T;
fn to_owned(&self) -> T
fn clone_into(&self, target: &mut T)

impl<T, U> Into<U> for DnsName<'a> where U: From<T>,

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom<U> for DnsName<'a> where U: Into<T>,

type Error = never;
fn try_from(value: U) -> Result<T, never>

impl<T, U> TryInto<U> for DnsName<'a> where U: TryFrom<T>,

type Error = <U as TryFrom<T>>::Error;
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>