#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum PropagationStatus {
OkNoChange,
OkChanged,
Failure,
}
impl PropagationStatus {
#[must_use]
pub const fn is_failure(self) -> bool {
matches!(self, Self::Failure)
}
#[must_use]
pub const fn changed(self) -> bool {
matches!(self, Self::OkChanged)
}
#[must_use]
pub const fn merge(self, other: Self) -> Self {
match (self, other) {
(Self::Failure, _) | (_, Self::Failure) => Self::Failure,
(Self::OkChanged, _) | (_, Self::OkChanged) => Self::OkChanged,
_ => Self::OkNoChange,
}
}
}