[][src]Struct libra_network_address::DnsName

pub struct DnsName(_);

A minimally parsed DNS name. We don't really do any checking other than enforcing:

  1. it is not an empty string
  2. it is not larger than 255 bytes
  3. it does not contain any forward slash '/' characters

From the DNS name syntax RFC, the standard rules are:

  1. the total size <= 255 bytes
  2. each label <= 63 bytes
  3. any binary string is valid

So the restrictions we're adding are (1) no '/' characters and (2) the name is a valid unicode string. We do this because '/' characters are already our protocol delimiter and Rust's [::std::net::ToSocketAddr] API requires a &str.

Trait Implementations

impl Arbitrary for DnsName[src]

type Parameters = ()

The type of parameters that arbitrary_with accepts for configuration of the generated Strategy. Parameters must implement Default. Read more

type Strategy = BoxedStrategy<Self>

The type of Strategy used to generate values of type Self. Read more

impl AsRef<str> for DnsName[src]

impl Clone for DnsName[src]

impl Debug for DnsName[src]

impl<'de> Deserialize<'de> for DnsName[src]

impl Display for DnsName[src]

impl Eq for DnsName[src]

impl FromStr for DnsName[src]

type Err = ParseError

The associated error which can be returned from parsing.

impl Into<String> for DnsName[src]

impl PartialEq<DnsName> for DnsName[src]

impl Serialize for DnsName[src]

impl StructuralEq for DnsName[src]

impl StructuralPartialEq for DnsName[src]

impl TryFrom<String> for DnsName[src]

type Error = ParseError

The type returned in the event of a conversion error.

Auto Trait Implementations

impl RefUnwindSafe for DnsName

impl Send for DnsName

impl Sync for DnsName

impl Unpin for DnsName

impl UnwindSafe for DnsName

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> TestOnlyHash for T where
    T: Serialize + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,