Trait tokio_dns::ToEndpoint[][src]

pub trait ToEndpoint<'a> {
    fn to_endpoint(self) -> Result<Endpoint<'a>>;
}

A trait for objects that can be converted into an Endpoint.

This trait is implemented for the following types:

  • SocketAddr, SocketAddrV4, SocketAddrV6 - a socket address.
  • (IpAddr, u16), (Ipv4Addr, u16), (Ipv6Addr, u16) - an IP address and a port
  • (&str, u16) - a <target> and a port.
  • &str - a string formatted as <target>:port.

Where <target> is a host name or an IP address.

This trait is similar to the ToSocketAddrs trait, except that it does not perform host name resolution.

Required Methods

Create an endpoint from this object.

Implementations on Foreign Types

impl<'a> ToEndpoint<'a> for SocketAddr
[src]

impl<'a, 'b> ToEndpoint<'a> for &'b SocketAddr
[src]

impl<'a> ToEndpoint<'a> for SocketAddrV4
[src]

impl<'a, 'b> ToEndpoint<'a> for &'b SocketAddrV4
[src]

impl<'a> ToEndpoint<'a> for SocketAddrV6
[src]

impl<'a, 'b> ToEndpoint<'a> for &'b SocketAddrV6
[src]

impl<'a> ToEndpoint<'a> for (IpAddr, u16)
[src]

impl<'a> ToEndpoint<'a> for (Ipv4Addr, u16)
[src]

impl<'a> ToEndpoint<'a> for (Ipv6Addr, u16)
[src]

impl<'a> ToEndpoint<'a> for (&'a str, u16)
[src]

impl<'a> ToEndpoint<'a> for &'a str
[src]

Implementors