pub fn recv_from(&self, buffer: &mut [u8]) -> io::Result<(usize, SocketAddrV4)> {
        let (size, addr) = self.datagram.recv_from(buffer)?;

        let addr = match addr {
            TargetAddr::Ip(addr) => match addr {
                SocketAddr::V4(addr) => addr,
                _ => return Err(io::Error::new(io::ErrorKind::Other, "invalid ip version")),
            },
            _ => return Err(io::Error::new(io::ErrorKind::Other, "invalid address type")),
        };

        Ok((size, addr))
    }
/// Receives a single datagram message on the socket.
Receives a single datagram message on the socket.
Receives a single datagram message on the socket .
pub fn recv_from(&self, buffer: &mut [u8]) -> io::Result<(usize, SocketAddrV4)> {
        let (size, addr) = self.datagram.recv_from(buffer)?;
        let addr = match addr {
            TargetAddr::Ip(addr) => match addr {
                SocketAddr::V4(addr) => addr,
                _ => return Err(io::Error::new(io::ErrorKind::Other, "invalid ip version")),
            },
            _ => return Err(io::Error::new(io::ErrorKind::Other, "invalid address type")),
        };
        Ok((size, addr))
    }
pub fn recv_from ( & self , buffer : & mut [ u8 ] ) -> io :: Result < ( usize , SocketAddrV4 ) > { let ( size , addr ) = self . datagram . recv_from ( buffer ) ? ; let addr = match addr { TargetAddr :: Ip ( addr ) => match addr { SocketAddr :: V4 ( addr ) => addr , _ => return Err ( io :: Error :: new ( io :: ErrorKind :: Other , " " ) ) , } , _ => return Err ( io :: Error :: new ( io :: ErrorKind :: Other , " " ) ) , } ; Ok ( ( size , addr ) ) }
Receives a single datagram message on the socket.
Receives a single datagram message on the socket .
&self
buffer
&mut [u8]