socket server with rust

This commit is contained in:
2025-03-06 00:33:08 +01:00
parent 553db4c8a6
commit 6b406c24d3
16 changed files with 2332 additions and 1476 deletions
+14
View File
@@ -0,0 +1,14 @@
use std::{collections::HashMap, sync::Arc};
use crate::io::{Database, Response};
pub fn handle_request(
database: Arc<Database>,
method: String,
params: HashMap<String, String>,
) -> Result<Response, String> {
match method.as_str() {
"ping" => Ok(Response::Pong),
_ => Err("Invalid request: ".to_string()),
}
}