#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub enum Phase {
Built,
Partitioned,
Scheduled,
}
impl Phase {
#[must_use]
pub const fn as_str(self) -> &'static str {
match self {
Self::Built => "built",
Self::Partitioned => "partitioned",
Self::Scheduled => "scheduled",
}
}
#[must_use]
pub const fn from_str(value: &str) -> Option<Self> {
match value.as_bytes() {
b"built" => Some(Self::Built),
b"partitioned" => Some(Self::Partitioned),
b"scheduled" => Some(Self::Scheduled),
_ => None,
}
}
}