/// Created by splitting `Pipe`, data written to this is available to be read from its `ReadHalf` counterpart.
#[derive(Debug, PartialEq, Eq)]
pubstructWriteHalf(i32);
/// A reader for a bi-directional unix pipe.
///
/// Created by splitting `Pipe`, data read from this is data that was sent to its `WriteHalf` counterpart.
#[derive(Debug, PartialEq, Eq)]
pubstructReadHalf(i32);
/// A bi-drectional unix pipe
///
/// Data written to the pipe is available to be read from it (unless the pipe is mismatched.)
#[derive(Debug, PartialEq, Eq)]
pubstructPipe
{
tx: i32,
rx: i32,
}
implPipe
{
/// Split this pipe into a read and write half.
///
/// Data written to the `WriteHalf` is sent to the `ReadHalf` (unless the pipe is mismatched.)
#[inline]pubfnsplit(self)-> (WriteHalf,ReadHalf)
{
(WriteHalf(self.tx),ReadHalf(self.rx))
}
/// Create a `Pipe` from two halves.
///
/// # Mismatched halves
/// The halves do not need to have originated from the same `Pipe`.
/// If they are not, then writing to the `Pipe` will send the data to its original receiver, and reading from it will take the data from its original sender.