add: live browser notifications

This commit is contained in:
trisua 2025-05-02 20:08:35 -04:00
parent 58d206eb81
commit 98d6f21e6e
18 changed files with 291 additions and 15 deletions

View file

@ -1,11 +1,19 @@
use serde::{Serialize, Deserialize, de::DeserializeOwned};
#[derive(Serialize, Deserialize, PartialEq, Eq)]
pub enum CrudMessageType {
Create,
Delete,
}
#[derive(Serialize, Deserialize, PartialEq, Eq)]
pub enum PacketType {
/// A regular check to ensure the connection is still alive.
Ping,
/// General text which can be ignored.
Text,
/// A CRUD operation.
Crud(CrudMessageType),
}
#[derive(Serialize, Deserialize, PartialEq, Eq)]
@ -20,6 +28,8 @@ pub enum SocketMethod {
Forward(PacketType),
/// A general packet from client to server. (ws to Redis pubsub)
Misc(PacketType),
/// A general packet from client to server. (ws to Redis pubsub)
Packet(PacketType),
}
#[derive(Serialize, Deserialize)]