use core::ops::Range;
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct BenchCase {
group: &'static str,
subject: &'static str,
}
impl BenchCase {
pub const fn new(group: &'static str, subject: &'static str) -> Self {
Self { group, subject }
}
pub const fn group(self) -> &'static str {
self.group
}
pub const fn subject(self) -> &'static str {
self.subject
}
}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct BenchRounds(u64);
impl BenchRounds {
pub const fn new(count: u64) -> Self {
Self(count)
}
pub const fn count(self) -> u64 {
self.0
}
}
impl IntoIterator for BenchRounds {
type IntoIter = Range<u64>;
type Item = u64;
fn into_iter(self) -> Self::IntoIter {
0..self.0
}
}
impl From<u64> for BenchRounds {
fn from(count: u64) -> Self {
Self::new(count)
}
}