feat: event management and websocket for updates

This commit is contained in:
Andrew Rioux
2025-02-22 16:04:15 -05:00
parent 005048f1ce
commit faaa4d2d1a
48 changed files with 1409 additions and 204 deletions
+26
View File
@@ -10,7 +10,10 @@ pub enum Error {
Pbkdf2(pbkdf2::password_hash::errors::Error),
#[cfg(feature = "ssr")]
Io(std::io::Error),
#[cfg(feature = "ssr")]
Axum(axum::Error),
AddrParse(std::net::AddrParseError),
Json(serde_json::Error),
}
impl std::fmt::Display for Error {
@@ -41,6 +44,13 @@ impl std::fmt::Display for Error {
Error::AddrParse(err) => {
write!(f, "ip address parse error: {err:?}")
}
Error::Json(err) => {
write!(f, "json encode/decode error: {err:?}")
}
#[cfg(feature = "ssr")]
Error::Axum(err) => {
write!(f, "axum error: {err:?}")
}
}
}
}
@@ -55,6 +65,9 @@ impl std::error::Error for Error {
#[cfg(feature = "ssr")]
Error::Io(err) => Some(err),
Error::AddrParse(err) => Some(err),
Error::Json(err) => Some(err),
#[cfg(feature = "ssr")]
Error::Axum(err) => Some(err),
_ => None,
}
}
@@ -112,3 +125,16 @@ impl From<std::net::AddrParseError> for Error {
Self::AddrParse(err)
}
}
impl From<serde_json::Error> for Error {
fn from(err: serde_json::Error) -> Self {
Self::Json(err)
}
}
#[cfg(feature = "ssr")]
impl From<axum::Error> for Error {
fn from(err: axum::Error) -> Self {
Self::Axum(err)
}
}