#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub enum Verdict {
Proven,
Refuted,
Unknown,
}
impl Verdict {
#[must_use]
pub const fn as_str(self) -> &'static str {
match self {
Self::Proven => "proven",
Self::Refuted => "refuted",
Self::Unknown => "unknown",
}
}
#[must_use]
pub const fn from_str(value: &str) -> Option<Self> {
match value.as_bytes() {
b"proven" => Some(Self::Proven),
b"refuted" => Some(Self::Refuted),
b"unknown" => Some(Self::Unknown),
_ => None,
}
}
#[must_use]
pub const fn is_proven(self) -> bool {
matches!(self, Self::Proven)
}
}