#[derive(Debug)]
pub enum Error {
Block,
Io,
Node,
Path,
Loop,
}
impl core::fmt::Display for Error {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
core::fmt::Debug::fmt(self, f)
}
}
#[cfg(any(feature = "std", test))]
impl std::error::Error for Error {}
impl From<InvalidBlock> for Error {
fn from(_: InvalidBlock) -> Self {
Self::Block
}
}
impl From<IoError> for Error {
fn from(_: IoError) -> Self {
Self::Io
}
}
#[derive(Debug)]
pub struct InvalidBlock;
impl core::fmt::Display for InvalidBlock {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
core::fmt::Debug::fmt(self, f)
}
}
#[cfg(any(feature = "std", test))]
impl std::error::Error for InvalidBlock {}
#[derive(Debug)]
pub struct InvalidPath;
impl core::fmt::Display for InvalidPath {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
core::fmt::Debug::fmt(self, f)
}
}
#[cfg(any(feature = "std", test))]
impl std::error::Error for InvalidPath {}
#[derive(Debug)]
pub struct IoError;
impl core::fmt::Display for IoError {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
core::fmt::Debug::fmt(self, f)
}
}
#[cfg(any(feature = "std", test))]
impl std::error::Error for IoError {}