ping

Trait TryFromSockAddr

Source
pub trait TryFromSockAddr: Sized {
    // Required method
    fn try_from(value: SockAddr) -> Result<Self>;
}
Expand description

Addresses which can be converted from socket2::SockAddr.

This trait exists to get around not being able to implement the foreign trait TryFrom<socket2::SockAddr> for the foreign types std::net::SocketAddr(V4|V6)?.

Required Methods§

Source

fn try_from(value: SockAddr) -> Result<Self>

Try to convert from socket2::SockAddr.

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§

Source§

impl TryFromSockAddr for SocketAddrV4

Source§

fn try_from(addr: SockAddr) -> Result<Self>

Source§

impl TryFromSockAddr for SocketAddrV6

Source§

fn try_from(addr: SockAddr) -> Result<Self>

Implementors§