#[non_exhaustive]pub enum MeterError {
Empty,
MixedDirections {
expected: Direction,
found: Direction,
},
RegisterRanBackwards {
at: OffsetDateTime,
from: Energy,
to: Energy,
},
ContradictoryReading {
at: OffsetDateTime,
one: Energy,
other: Energy,
},
}Expand description
What can be wrong with a series of readings.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Empty
No readings at all.
MixedDirections
A reading counts the other direction.
RegisterRanBackwards
The register decreased between two readings.
ContradictoryReading
Two readings state different values for one register at one instant.
A meter had one value at that moment, so one of the two is wrong — and
which one decides the energy on both sides of the boundary. Kept apart
from Self::RegisterRanBackwards because it is a different fault with
a different fix: a register that decreased over time is a metrology
incident, while two values at one instant is a station or a transport
sending the same reading twice with different content.
Trait Implementations§
Source§impl Clone for MeterError
impl Clone for MeterError
Source§impl Debug for MeterError
impl Debug for MeterError
Source§impl Display for MeterError
impl Display for MeterError
impl Eq for MeterError
Source§impl Error for MeterError
impl Error for MeterError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl PartialEq for MeterError
impl PartialEq for MeterError
impl StructuralPartialEq for MeterError
Auto Trait Implementations§
impl Forget for MeterError
impl Freeze for MeterError
impl Move for MeterError
impl RefUnwindSafe for MeterError
impl Send for MeterError
impl Sync for MeterError
impl Unpin for MeterError
impl UnsafeUnpin for MeterErrorwhere
NonZeroI32Inner: UnsafeUnpin,
impl UnwindSafe for MeterError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more