This commit is contained in:
sam 2024-01-15 16:39:31 +01:00
commit 00eca2801f
Signed by: sam
GPG key ID: B4EF20DDE721CAA1
18 changed files with 2837 additions and 0 deletions

10
foxchat/Cargo.toml Normal file
View file

@ -0,0 +1,10 @@
[package]
name = "foxchat"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
serde = { version = "1.0.195", features = ["derive"] }
uuid = { version = "1.6.1", features = ["v7"] }

1
foxchat/src/lib.rs Normal file
View file

@ -0,0 +1 @@
pub mod s2s;

18
foxchat/src/s2s/event.rs Normal file
View file

@ -0,0 +1,18 @@
use serde::{Deserialize, Serialize};
#[derive(Debug, Serialize, Deserialize)]
#[serde(tag = "t", content = "d", rename_all = "SCREAMING_SNAKE_CASE")]
pub enum Payload {
Dispatch {
#[serde(rename = "e")]
event: DispatchEvent,
#[serde(rename = "r")]
recipients: Vec<String>,
},
Hello,
Identify { token: String },
}
#[derive(Debug, Serialize, Deserialize)]
#[serde(tag = "t", content = "d", rename_all = "SCREAMING_SNAKE_CASE")]
pub enum DispatchEvent {}

3
foxchat/src/s2s/mod.rs Normal file
View file

@ -0,0 +1,3 @@
mod event;
pub use event::{Payload, DispatchEvent};