#[derive(thiserror::Error, Debug)]
pub enum Error {
#[error("io: {0}")]
Io(
#[doc = "The I/O error that occurred."]
#[from]
#[source]
std::io::Error,
),
#[error("serialisation: {0}")]
Serialise(#[doc = "The message of the internal error."] String),
#[error("deserialisation: {0}")]
Deserialise(#[doc = "The message of the internal error."] String),
#[cfg(feature = "async-tokio")]
#[error("tokio join failed: {0}")]
TokioJoin(
#[doc = "The join error that occurred."]
#[from]
tokio::task::JoinError,
),
#[error("{}", if *.0 { "was closed by operation" } else { "already closed" })]
Closed(
#[doc = "Whether it was closed by the operation (`true`) or was already closed (`false`)"]
bool,
),
}
pub type Result<T> = std::result::Result<T, Error>;