pub async fn send_to(&mut self, buf: &[u8], target: &ManagerSocketAddr) -> io::Result<usize> {
        match *self {
            ManagerDatagram::UdpDatagram(ref mut udp) => match *target {
                ManagerSocketAddr::SocketAddr(ref saddr) => udp.send_to(buf, saddr).await,
                #[cfg(unix)]
                ManagerSocketAddr::UnixSocketAddr(..) => {
                    let err = Error::new(ErrorKind::InvalidInput, "udp datagram requires IP address target");
                    Err(err)
                }
            },
            #[cfg(unix)]
            ManagerDatagram::UnixDatagram(ref mut unix) => match *target {
                ManagerSocketAddr::UnixSocketAddr(ref saddr) => match saddr.as_pathname() {
                    Some(paddr) => unix.send_to(buf, paddr).await,
                    None => {
                        let err = Error::new(ErrorKind::InvalidInput, "target address must not be unnamed");
                        Err(err)
                    }
                },
                ManagerSocketAddr::SocketAddr(..) => {
                    let err = Error::new(ErrorKind::InvalidInput, "unix datagram requires path address target");
                    Err(err)
                }
            },
        }
    }
/// Sends data on the socket to the specified address.
Sends data on the socket to the specified address.
Sends data on the socket to the specified address .
pub async fn send_to(&mut self, buf: &[u8], target: &ManagerSocketAddr) -> io::Result<usize> {
        match *self {
            ManagerDatagram::UdpDatagram(ref mut udp) => match *target {
                ManagerSocketAddr::SocketAddr(ref saddr) => udp.send_to(buf, saddr).await,
                #[cfg(unix)]
                ManagerSocketAddr::UnixSocketAddr(..) => {
                    let err = Error::new(ErrorKind::InvalidInput, "udp datagram requires IP address target");
                    Err(err)
                }
            },
            #[cfg(unix)]
            ManagerDatagram::UnixDatagram(ref mut unix) => match *target {
                ManagerSocketAddr::UnixSocketAddr(ref saddr) => match saddr.as_pathname() {
                    Some(paddr) => unix.send_to(buf, paddr).await,
                    None => {
                        let err = Error::new(ErrorKind::InvalidInput, "target address must not be unnamed");
                        Err(err)
                    }
                },
                ManagerSocketAddr::SocketAddr(..) => {
                    let err = Error::new(ErrorKind::InvalidInput, "unix datagram requires path address target");
                    Err(err)
                }
            },
        }
    }
pub async fn send_to ( & mut self , buf : & [ u8 ] , target : & ManagerSocketAddr ) -> io :: Result < usize > { match * self { ManagerDatagram :: UdpDatagram ( ref mut udp ) => match * target { ManagerSocketAddr :: SocketAddr ( ref saddr ) => udp . send_to ( buf , saddr ) . await , # [ cfg ( unix ) ] ManagerSocketAddr :: UnixSocketAddr ( .. ) => { let err = Error :: new ( ErrorKind :: InvalidInput , " " ) ; Err ( err ) } } , # [ cfg ( unix ) ] ManagerDatagram :: UnixDatagram ( ref mut unix ) => match * target { ManagerSocketAddr :: UnixSocketAddr ( ref saddr ) => match saddr . as_pathname ( ) { Some ( paddr ) => unix . send_to ( buf , paddr ) . await , None => { let err = Error :: new ( ErrorKind :: InvalidInput , " " ) ; Err ( err ) } } , ManagerSocketAddr :: SocketAddr ( .. ) => { let err = Error :: new ( ErrorKind :: InvalidInput , " " ) ; Err ( err ) } } , } }
Sends data on the socket to the specified address.
Sends data on the socket to the specified address .
&mut self
buf
&[u8]
target
&ManagerSocketAddr
&mut self
buf
&[u8]
target
&ManagerSocketAddr