pub fn pair() -> Result<(UnixStream, UnixStream)> {
        let (stream1, stream2) = net::UnixStream::pair()?;
        let stream1 = GlommioStream::from(socket2::Socket::from(stream1));
        let stream2 = GlommioStream::from(socket2::Socket::from(stream2));
        let stream1 = Self { stream: stream1 };
        let stream2 = Self { stream: stream2 };
        Ok((stream1, stream2))
    }
/// Creates an unnamed pair of connected Unix stream sockets.
///
/// # Examples
///
/// ```
/// use futures_lite::io::{AsyncReadExt, AsyncWriteExt};
/// use glommio::{net::UnixStream, LocalExecutor};
///
/// let ex = LocalExecutor::default();
/// ex.run(async move {
///     let (mut p1, mut p2) = UnixStream::pair().unwrap();
///     let sz = p1.write(&[65u8; 1]).await.unwrap();
///     let mut buf = [0u8; 1];
///     let sz = p2.read(&mut buf).await.unwrap();
/// })
/// ```
Creates an unnamed pair of connected Unix stream sockets.
Creates an unnamed pair of connected Unix stream sockets .
pub fn pair() -> Result<(UnixStream, UnixStream)> {
        let (stream1, stream2) = net::UnixStream::pair()?;
        let stream1 = GlommioStream::from(socket2::Socket::from(stream1));
        let stream2 = GlommioStream::from(socket2::Socket::from(stream2));
        let stream1 = Self { stream: stream1 };
        let stream2 = Self { stream: stream2 };
        Ok((stream1, stream2))
    }
pub fn pair ( ) -> Result < ( UnixStream , UnixStream ) > { let ( stream1 , stream2 ) = net :: UnixStream :: pair ( ) ? ; let stream1 = GlommioStream :: from ( socket2 :: Socket :: from ( stream1 ) ) ; let stream2 = GlommioStream :: from ( socket2 :: Socket :: from ( stream2 ) ) ; let stream1 = Self { stream : stream1 } ; let stream2 = Self { stream : stream2 } ; Ok ( ( stream1 , stream2 ) ) }
Creates an unnamed pair of connected Unix stream sockets.
Creates an unnamed pair of connected Unix stream sockets .
examples
```
use futures_lite::io::{AsyncReadExt, AsyncWriteExt};
use glommio::{net::UnixStream, LocalExecutor}.

let ex = LocalExecutor::default();
ex.run(async move {
let (mut p1, mut p2) = UnixStream::pair().unwrap();
let sz = p1.write(&[65u8; 1]).await.unwrap();
let mut buf = [0u8; 1];
let sz = p2.read(&mut buf).await.unwrap();
})
```
` ` ` use futures_lite :: io :: { AsyncReadExt AsyncWriteExt } ; use glommio :: { net :: UnixStream LocalExecutor } . let ex = LocalExecutor :: default () ; ex . run ( async move { let ( mut p1 mut p2 ) = UnixStream :: pair () . unwrap () ; let sz = p1 . write ( & [ 65u8 ; 1 ] ) . await . unwrap () ; let mut buf = [ 0u8 ; 1 ] ; let sz = p2 . read ( &mut buf ) . await . unwrap () ; } ) ` ` `