redup_bootstrap/
snapshot.rs1use redup_abstractions::Phase;
4
5#[derive(Debug, Clone, PartialEq, Eq)]
7pub struct ModuleSnapshot {
8 name: &'static str,
9 phase: Phase,
10}
11
12impl ModuleSnapshot {
13 pub(crate) fn new(name: &'static str, phase: Phase) -> Self {
14 Self { name, phase }
15 }
16
17 pub fn name(&self) -> &'static str {
19 self.name
20 }
21
22 pub fn phase(&self) -> Phase {
24 self.phase
25 }
26}
27
28#[derive(Debug, Clone, PartialEq, Eq)]
30pub struct Snapshot {
31 readiness: Phase,
32 liveness: Phase,
33 modules: Vec<ModuleSnapshot>,
34}
35
36impl Snapshot {
37 pub(crate) fn new(readiness: Phase, liveness: Phase, modules: Vec<ModuleSnapshot>) -> Self {
38 Self {
39 readiness,
40 liveness,
41 modules,
42 }
43 }
44
45 pub fn readiness(&self) -> Phase {
47 self.readiness
48 }
49
50 pub fn liveness(&self) -> Phase {
52 self.liveness
53 }
54
55 pub fn modules(&self) -> &[ModuleSnapshot] {
57 &self.modules
58 }
59}