/// Creates a raw socket address from `SocketAddr`.
Creates a raw socket address from `SocketAddr`.
Creates a raw socket address from ` SocketAddr ` .
fn new(addr: SocketAddr) -> Self {
        let (addr, len): (*const sockaddr, socklen_t) = match &addr {
            SocketAddr::V4(addr) => (addr as *const _ as *const _, mem::size_of_val(addr) as _),
            SocketAddr::V6(addr) => (addr as *const _ as *const _, mem::size_of_val(addr) as _),
        };
        unsafe { Self::from_raw_parts(addr, len) }
    }
fn new ( addr : SocketAddr ) -> Self { let ( addr , len ) : ( * const sockaddr , socklen_t ) = match & addr { SocketAddr :: V4 ( addr ) => ( addr as * const _ as * const _ , mem :: size_of_val ( addr ) as _ ) , SocketAddr :: V6 ( addr ) => ( addr as * const _ as * const _ , mem :: size_of_val ( addr ) as _ ) , } ; unsafe { Self :: from_raw_parts ( addr , len ) } }
Creates a raw socket address from `SocketAddr`.
Creates a raw socket address from ` SocketAddr ` .
addr
SocketAddr