Trait IntoName

pub trait IntoName: Sized {
    // Required methods
    fn into_name(self) -> Result<Name, ProtoError>;
    fn to_ip(&self) -> Option<IpAddr>;
}
Expand description

Conversion into a Name

Required Methods§

fn into_name(self) -> Result<Name, ProtoError>

Convert this into Name

fn to_ip(&self) -> Option<IpAddr>

Check if this value is a valid IP address

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

§

impl IntoName for &str

§

fn into_name(self) -> Result<Name, ProtoError>

Performs a utf8, IDNA or punycode, translation of the str into Name

§

fn to_ip(&self) -> Option<IpAddr>

Implementors§

§

impl IntoName for &String

§

impl IntoName for String

§

impl<T> IntoName for T
where T: Into<Name>,