1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
use serde::{Deserialize, Serialize};
use types::SequenceNumber;
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, Eq)]
pub struct ExecutionIndices {
pub next_certificate_index: SequenceNumber,
pub next_batch_index: SequenceNumber,
pub next_transaction_index: SequenceNumber,
}
impl Ord for ExecutionIndices {
fn cmp(&self, other: &Self) -> std::cmp::Ordering {
(
self.next_certificate_index,
self.next_batch_index,
self.next_transaction_index,
)
.cmp(&(
other.next_certificate_index,
other.next_batch_index,
other.next_transaction_index,
))
}
}
impl PartialOrd for ExecutionIndices {
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
Some(self.cmp(other))
}
}