Trading card city builder game?

empty websocket handler because i found it was not possible to implement using this library

eldridge.cam dc7259a3 db32f17d

Waiting for spindle ...
+38 -6
+5
Cargo.lock
··· 336 336 version = "0.1.0" 337 337 dependencies = [ 338 338 "dioxus", 339 + "futures", 340 + "serde", 339 341 "sqlx", 342 + "tokio", 343 + "tokio-stream", 344 + "tracing", 340 345 ] 341 346 342 347 [[package]]
+10 -5
Cargo.toml
··· 8 8 9 9 [dependencies] 10 10 dioxus = { version = "0.7.1", features = ["router", "fullstack"] } 11 + futures = "0.3.31" 12 + serde = { version = "1.0.228", features = ["derive"] } 11 13 sqlx = { version = "0.8.6", features = ["runtime-tokio", "postgres"], optional = true } 14 + tokio = { version = "1.49.0", features = ["macros"] } 15 + tokio-stream = "0.1.18" 16 + tracing = "0.1.44" 12 17 13 18 [features] 14 - default = ["web"] 15 - web = ["dioxus/web"] 16 - desktop = ["dioxus/desktop"] 17 - mobile = ["dioxus/mobile"] 18 - server = ["dioxus/server", "dep:sqlx"] 19 + default = ["web", "server"] 20 + web = ["dioxus/web", "tokio/rt"] 21 + desktop = ["dioxus/desktop", "tokio/rt"] 22 + mobile = ["dioxus/mobile", "tokio/rt"] 23 + server = ["dioxus/server", "tokio/rt-multi-thread", "dep:sqlx"]
+1 -1
Justfile
··· 20 20 21 21 [group: "run"] 22 22 dev: up 23 - dx serve --hot-patch 23 + dx serve 24 24 25 25 [group: "dev"] 26 26 init:
+2
src/api.rs
··· 1 1 use dioxus::prelude::*; 2 2 3 + pub mod ws; 4 + 3 5 /// Echo the user input on the server. 4 6 #[post("/api/echo")] 5 7 pub async fn echo_server(input: String) -> Result<String, ServerFnError> {
+20
src/api/ws.rs
··· 1 + use dioxus::fullstack::{WebSocketOptions, Websocket}; 2 + use dioxus::prelude::*; 3 + use serde::{Deserialize, Serialize}; 4 + 5 + #[derive(Serialize, Deserialize, Clone, Debug)] 6 + pub enum Request { 7 + Authenticate(String), 8 + } 9 + 10 + #[derive(Serialize, Deserialize, Clone, Debug)] 11 + pub enum Response { 12 + Authenticated(String), 13 + } 14 + 15 + #[get("/api/ws")] 16 + pub async fn v1(options: WebSocketOptions) -> Result<Websocket<Request, Response>> { 17 + let socket = options.on_upgrade(move |socket| async move { 18 + }); 19 + Ok(socket) 20 + }