performance_mark/error.rs
1#[derive(Debug, Clone, Copy)]
2/// This crate's Error object.
3#[non_exhaustive]
4pub enum Error {
5 /// `end()` called on a [crate::PerformancePeriod] before `start()`
6 EndBeforeStart,
7}
8
9impl std::error::Error for Error {}
10
11impl std::fmt::Display for Error {
12 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
13 match self {
14 Error::EndBeforeStart => write!(f, "end() called before start()"),
15 }
16 }
17}