bee_storage/system/
health.rs1use core::convert::Infallible;
7
8#[derive(Debug, thiserror::Error)]
10pub enum Error {
11 #[error("i/o error happened: {0:?}")]
13 Io(#[from] std::io::Error),
14 #[error("unknown storage health variant: {0}")]
16 UnknownHealth(u8),
17}
18
19impl From<Infallible> for Error {
20 fn from(err: Infallible) -> Self {
21 match err {}
22 }
23}
24
25#[repr(u8)]
27#[derive(Debug, Copy, Clone, Eq, PartialEq, packable::Packable)]
28#[packable(unpack_error = Error)]
29#[packable(tag_type = u8, with_error = Error::UnknownHealth)]
30pub enum StorageHealth {
31 Healthy = 0,
33 Idle = 1,
35 Corrupted = 2,
37}