use std::fmt;
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub enum ProgressPhase {
Started,
Running,
Finished,
Failed,
Canceled,
}
impl ProgressPhase {
#[inline]
pub const fn as_str(self) -> &'static str {
match self {
Self::Started => "started",
Self::Running => "running",
Self::Finished => "finished",
Self::Failed => "failed",
Self::Canceled => "canceled",
}
}
}
impl fmt::Display for ProgressPhase {
#[inline]
fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
formatter.write_str(self.as_str())
}
}