pub enum TimingError {
NoIterations {
count: u32,
},
Execution(String),
}Expand description
Errors that can occur during benchmark execution.
§Example
use mobench_sdk::timing::{BenchSpec, TimingError};
// Zero iterations produces an error
let result = BenchSpec::new("test", 0, 10);
assert!(matches!(result, Err(TimingError::NoIterations { .. })));Variants§
NoIterations
The iteration count was zero or invalid.
At least one iteration is required to produce a measurement. The error includes the actual value provided for diagnostic purposes.
Execution(String)
The benchmark function failed during execution.
Contains a description of the failure.
Trait Implementations§
Source§impl Debug for TimingError
impl Debug for TimingError
Source§impl Display for TimingError
impl Display for TimingError
Source§impl Error for TimingError
impl Error for TimingError
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 From<TimingError> for BenchError
impl From<TimingError> for BenchError
Source§fn from(source: TimingError) -> Self
fn from(source: TimingError) -> Self
Converts to this type from the input type.
Source§impl From<TimingError> for BenchErrorVariant
impl From<TimingError> for BenchErrorVariant
Source§fn from(err: TimingError) -> Self
fn from(err: TimingError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for TimingError
impl RefUnwindSafe for TimingError
impl Send for TimingError
impl Sync for TimingError
impl Unpin for TimingError
impl UnwindSafe for TimingError
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