diff options
| author | diogo464 <[email protected]> | 2025-12-05 15:09:09 +0000 |
|---|---|---|
| committer | diogo464 <[email protected]> | 2025-12-05 15:09:09 +0000 |
| commit | 9696489d5f1807a507214d6fcdecac4d47e0356d (patch) | |
| tree | 4896eb452c7e410cb1166a1dbd13bcea45861516 /src/binary_state.rs | |
| parent | 0c86da392af50c7588b087c3f72602e8368af65e (diff) | |
reworked entity storage
Diffstat (limited to 'src/binary_state.rs')
| -rw-r--r-- | src/binary_state.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/binary_state.rs b/src/binary_state.rs index d512856..5648a18 100644 --- a/src/binary_state.rs +++ b/src/binary_state.rs | |||
| @@ -2,8 +2,17 @@ use core::str::FromStr; | |||
| 2 | 2 | ||
| 3 | use crate::constants; | 3 | use crate::constants; |
| 4 | 4 | ||
| 5 | #[derive(Debug)] | ||
| 5 | pub struct InvalidBinaryState; | 6 | pub struct InvalidBinaryState; |
| 6 | 7 | ||
| 8 | impl core::fmt::Display for InvalidBinaryState { | ||
| 9 | fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { | ||
| 10 | f.write_str("invalid binary state, allowed values are 'ON' and 'OFF' (case insensitive)") | ||
| 11 | } | ||
| 12 | } | ||
| 13 | |||
| 14 | impl core::error::Error for InvalidBinaryState {} | ||
| 15 | |||
| 7 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] | 16 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] |
| 8 | pub enum BinaryState { | 17 | pub enum BinaryState { |
| 9 | On, | 18 | On, |
