rush_sync_server/server/
manager.rs

1// src/server/manager.rs - MINIMAL VERSION (optional utility wrapper)
2use crate::core::prelude::*;
3use crate::server::types::{ServerContext, ServerInfo};
4
5#[derive(Debug)]
6pub struct ServerManager {
7    ctx: ServerContext,
8}
9
10impl ServerManager {
11    pub fn new() -> Self {
12        Self {
13            ctx: ServerContext::new(),
14        }
15    }
16
17    // Optional: Get server info utility
18    pub fn get_server_info(&self, identifier: &str) -> Result<ServerInfo> {
19        let servers = self.ctx.servers.read().unwrap();
20        let server = crate::server::utils::validation::find_server(&servers, identifier)?;
21        Ok(server.clone())
22    }
23
24    // Optional: Access to context for complex operations
25    pub fn get_context(&self) -> &ServerContext {
26        &self.ctx
27    }
28}
29
30impl Default for ServerManager {
31    fn default() -> Self {
32        Self::new()
33    }
34}