pub enum CounterError {
LengthMismatch {
times: usize,
values: usize,
},
TooFewReadings {
got: usize,
},
NotFinite {
parameter: &'static str,
index: Option<usize>,
},
Unordered {
parameter: &'static str,
index: usize,
},
NotPositive {
parameter: &'static str,
got: f64,
},
OutsideModulus {
parameter: &'static str,
index: usize,
got: f64,
modulus: f64,
},
OutsideReadings {
index: usize,
got: f64,
first: f64,
last: f64,
},
TwoInOnePair {
index: usize,
},
}Expand description
Why readings, settings or intervals were refused.
Variants§
LengthMismatch
times and values differ in length.
TooFewReadings
Fewer than two readings: there is no pair.
NotFinite
A NaN or an infinity. parameter names the input (times, values,
discontinuities.time, …), index its position.
Fields
Unordered
A time not after the one before it (times, or interval edges).
Fields
NotPositive
modulus or max_rate not above 0.
OutsideModulus
A value outside [0, modulus): a register with that wrap value never
shows it.
Fields
OutsideReadings
A discontinuity whose time lies in no pair: at or before the first reading, or after the last.
Fields
TwoInOnePair
Two discontinuities in one pair of readings: what the counter showed between them was not read.
Trait Implementations§
Source§impl Clone for CounterError
impl Clone for CounterError
impl Copy for CounterError
Source§impl Debug for CounterError
impl Debug for CounterError
Source§impl Display for CounterError
impl Display for CounterError
Source§impl Error for CounterError
impl Error for CounterError
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 CounterError
impl PartialEq for CounterError
impl StructuralPartialEq for CounterError
Auto Trait Implementations§
impl Freeze for CounterError
impl RefUnwindSafe for CounterError
impl Send for CounterError
impl Sync for CounterError
impl Unpin for CounterError
impl UnsafeUnpin for CounterError
impl UnwindSafe for CounterError
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