#[non_exhaustive]pub enum CounterError {
NotInvariant,
NoRate,
ImplausibleRate {
hertz: u64,
},
}Expand description
Why Counter::discover found no counter to read as time.
§Examples
use t2t_clock::CounterError;
let refusal = CounterError::ImplausibleRate { hertz: 42 };
assert_eq!(
refusal.to_string(),
"counter error: a rate of 42 Hz is outside 1 MHz to 10 GHz",
"it names the rate it refused"
);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.
NotInvariant
The time-stamp counter’s rate follows the core’s, so its ticks have no fixed length.
NoRate
The CPU reports no rate, and none could be measured.
ImplausibleRate
The rate is outside what any counter runs at.
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
impl Eq 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 Hash for CounterError
impl Hash for CounterError
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