pub fn pair() -> Result<(UnixDatagram, UnixDatagram)> {
        let (socket1, socket2) = net::UnixDatagram::pair()?;
        let socket1 = GlommioDatagram::from(socket2::Socket::from(socket1));
        let socket2 = GlommioDatagram::from(socket2::Socket::from(socket2));
        let socket1 = Self { socket: socket1 };
        let socket2 = Self { socket: socket2 };
        Ok((socket1, socket2))
    }
/// Creates an unnamed pair of connected Unix Datagram sockets.
///
/// # Examples
///
/// ```
/// use glommio::{net::UnixDatagram, LocalExecutor};
///
/// let ex = LocalExecutor::default();
/// ex.run(async move {
///     let (mut p1, mut p2) = UnixDatagram::pair().unwrap();
///     let sz = p1.send(&[65u8; 1]).await.unwrap();
///     let mut buf = [0u8; 1];
///     let sz = p2.recv(&mut buf).await.unwrap();
/// })
/// ```
Creates an unnamed pair of connected Unix Datagram sockets.
Creates an unnamed pair of connected Unix Datagram sockets .
pub fn pair() -> Result<(UnixDatagram, UnixDatagram)> {
        let (socket1, socket2) = net::UnixDatagram::pair()?;
        let socket1 = GlommioDatagram::from(socket2::Socket::from(socket1));
        let socket2 = GlommioDatagram::from(socket2::Socket::from(socket2));
        let socket1 = Self { socket: socket1 };
        let socket2 = Self { socket: socket2 };
        Ok((socket1, socket2))
    }
pub fn pair ( ) -> Result < ( UnixDatagram , UnixDatagram ) > { let ( socket1 , socket2 ) = net :: UnixDatagram :: pair ( ) ? ; let socket1 = GlommioDatagram :: from ( socket2 :: Socket :: from ( socket1 ) ) ; let socket2 = GlommioDatagram :: from ( socket2 :: Socket :: from ( socket2 ) ) ; let socket1 = Self { socket : socket1 } ; let socket2 = Self { socket : socket2 } ; Ok ( ( socket1 , socket2 ) ) }
Creates an unnamed pair of connected Unix Datagram sockets.
Creates an unnamed pair of connected Unix Datagram sockets .
examples
```
use glommio::{net::UnixDatagram, LocalExecutor}.

let ex = LocalExecutor::default();
ex.run(async move {
let (mut p1, mut p2) = UnixDatagram::pair().unwrap();
let sz = p1.send(&[65u8; 1]).await.unwrap();
let mut buf = [0u8; 1];
let sz = p2.recv(&mut buf).await.unwrap();
})
```
` ` ` use glommio :: { net :: UnixDatagram LocalExecutor } . let ex = LocalExecutor :: default () ; ex . run ( async move { let ( mut p1 mut p2 ) = UnixDatagram :: pair () . unwrap () ; let sz = p1 . send ( & [ 65u8 ; 1 ] ) . await . unwrap () ; let mut buf = [ 0u8 ; 1 ] ; let sz = p2 . recv ( &mut buf ) . await . unwrap () ; } ) ` ` `