use core::convert::Infallible;
#[derive(Debug, thiserror::Error)]
pub enum Error {
#[error("i/o error happened: {0:?}")]
Io(#[from] std::io::Error),
#[error("unknown storage health variant: {0}")]
UnknownHealth(u8),
}
impl From<Infallible> for Error {
fn from(err: Infallible) -> Self {
match err {}
}
}
#[repr(u8)]
#[derive(Debug, Copy, Clone, Eq, PartialEq, packable::Packable)]
#[packable(unpack_error = Error)]
#[packable(tag_type = u8, with_error = Error::UnknownHealth)]
pub enum StorageHealth {
Healthy = 0,
Idle = 1,
Corrupted = 2,
}