laminar_core/checkpoint/
authority.rs1use uuid::Uuid;
4
5#[derive(Debug, Clone, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
7pub struct LeaderProofOwner {
8 pub node_id: u64,
10 pub boot_id: Uuid,
12 pub process_term: u64,
14}
15
16impl LeaderProofOwner {
17 #[must_use]
19 pub fn is_canonical(&self) -> bool {
20 self.node_id != 0 && !self.boot_id.is_nil() && self.process_term != 0
21 }
22}
23
24#[derive(Debug, Clone, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
26pub struct LeaderProof {
27 pub owner: LeaderProofOwner,
29 pub fencing_token: u64,
31}
32
33impl LeaderProof {
34 #[must_use]
36 pub fn is_canonical(&self) -> bool {
37 self.owner.is_canonical() && self.fencing_token != 0
38 }
39}