1#[derive(Clone, Copy, Debug, PartialEq, Eq)]
3pub enum PropagationStatus {
4 OkNoChange,
6 OkChanged,
8 Failure,
10}
11
12impl PropagationStatus {
13 #[must_use]
15 pub const fn is_failure(self) -> bool {
16 matches!(self, Self::Failure)
17 }
18
19 #[must_use]
21 pub const fn changed(self) -> bool {
22 matches!(self, Self::OkChanged)
23 }
24
25 #[must_use]
27 pub const fn merge(self, other: Self) -> Self {
28 match (self, other) {
29 (Self::Failure, _) | (_, Self::Failure) => Self::Failure,
30 (Self::OkChanged, _) | (_, Self::OkChanged) => Self::OkChanged,
31 _ => Self::OkNoChange,
32 }
33 }
34}