init
This commit is contained in:
commit
00eca2801f
18 changed files with 2837 additions and 0 deletions
10
foxchat/Cargo.toml
Normal file
10
foxchat/Cargo.toml
Normal 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
1
foxchat/src/lib.rs
Normal file
|
@ -0,0 +1 @@
|
|||
pub mod s2s;
|
18
foxchat/src/s2s/event.rs
Normal file
18
foxchat/src/s2s/event.rs
Normal 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
3
foxchat/src/s2s/mod.rs
Normal file
|
@ -0,0 +1,3 @@
|
|||
mod event;
|
||||
|
||||
pub use event::{Payload, DispatchEvent};
|
Loading…
Add table
Add a link
Reference in a new issue