feat: add an Error type to Packet::parse

instead of error logging manually inside `parse`,
return a Result with a custom enum
This commit is contained in:
Tamipes 2025-12-03 22:58:21 +01:00
parent 92dfbd490c
commit 4cf3d5aea0
5 changed files with 69 additions and 60 deletions

View file

@ -265,10 +265,19 @@ where
dep.labels().values().filter(|x| x.as_str() == str).count() > 0
}
#[derive(Debug)]
pub enum ServerDeploymentStatus {
Connectable(TcpStream),
Starting,
PodOk,
Offline,
}
impl fmt::Debug for ServerDeploymentStatus {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
Self::Connectable(_) => write!(f, "Connectable"),
Self::Starting => write!(f, "Starting"),
Self::PodOk => write!(f, "PodOk"),
Self::Offline => write!(f, "Offline"),
}
}
}