use thiserror::Error;
#[derive(Error, Debug)]
#[non_exhaustive]
pub enum Error {
#[error("I/O error: {0}")]
Io(#[from] std::io::Error),
#[error("Missing child stdout: {0}")]
MissingChildStdout(&'static str),
#[error("Missing child stdin: {0}")]
MissingChildStdin(&'static str),
#[cfg(any(feature = "chacha20", feature = "salsa20", feature = "aes_ctr"))]
#[error("Cipher error: {0}")]
Cipher(String),
#[error("Other error: {0}")]
Other(String),
#[cfg(feature = "wincode")]
#[error("Wincode read error: {0}")]
WincodeRead(#[from] wincode::ReadError),
#[cfg(feature = "wincode")]
#[error("Wincode write error: {0}")]
WincodeWrite(#[from] wincode::WriteError),
#[cfg(feature = "wincode")]
#[error("Wincode IO write error: {0}")]
WincodeIoWrite(#[from] wincode::io::WriteError),
#[error("UTF-8 decoding error: {0}")]
FromUtf8(#[from] std::string::FromUtf8Error),
}
pub type Result<T> = std::result::Result<T, Error>;