1use core::ops::Range;
4
5#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
10pub struct BenchCase {
11 group: &'static str,
12 subject: &'static str,
13}
14
15impl BenchCase {
16 pub const fn new(group: &'static str, subject: &'static str) -> Self {
18 Self { group, subject }
19 }
20
21 pub const fn group(self) -> &'static str {
23 self.group
24 }
25
26 pub const fn subject(self) -> &'static str {
28 self.subject
29 }
30}
31
32#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
34pub struct BenchRounds(u64);
35
36impl BenchRounds {
37 pub const fn new(count: u64) -> Self {
39 Self(count)
40 }
41
42 pub const fn count(self) -> u64 {
44 self.0
45 }
46}
47
48impl IntoIterator for BenchRounds {
49 type IntoIter = Range<u64>;
50 type Item = u64;
51
52 fn into_iter(self) -> Self::IntoIter {
54 0..self.0
55 }
56}
57
58impl From<u64> for BenchRounds {
59 fn from(count: u64) -> Self {
60 Self::new(count)
61 }
62}