#[cfg(feature = "io")]
#[cfg_attr(docsrs, doc(cfg(feature = "io")))]
pub mod pipe;
#[cfg(feature = "async-io")]
#[cfg_attr(docsrs, doc(cfg(feature = "async-io")))]
pub mod async_pipe;
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub enum PipeError {
Closed,
Eof,
}
impl PipeError {
#[inline]
pub const fn is_eof(&self) -> bool {
matches!(self, Self::Eof)
}
#[inline]
pub const fn is_closed(&self) -> bool {
matches!(self, Self::Closed)
}
}
impl core::fmt::Display for PipeError {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
match self {
PipeError::Closed => write!(f, "Pipe: read/write on closed pipe"),
PipeError::Eof => write!(f, "Pipe: EOF"),
}
}
}
impl std::error::Error for PipeError {}