diff --git a/src-tauri/src/mcp/mod.rs b/src-tauri/src/mcp/mod.rs index 8147157..faa2a2a 100644 --- a/src-tauri/src/mcp/mod.rs +++ b/src-tauri/src/mcp/mod.rs @@ -19,12 +19,12 @@ use crate::mcp::scrollback::ScrollbackBuffer; /// Shared between SSH/PTY output loops (writers) and MCP tools (readers). #[derive(Clone)] pub struct ScrollbackRegistry { - buffers: DashMap>, + buffers: Arc>>, } impl ScrollbackRegistry { pub fn new() -> Self { - Self { buffers: DashMap::new() } + Self { buffers: Arc::new(DashMap::new()) } } /// Create and register a new scrollback buffer for a session. diff --git a/src-tauri/src/rdp/mod.rs b/src-tauri/src/rdp/mod.rs index e049302..d43f9dd 100644 --- a/src-tauri/src/rdp/mod.rs +++ b/src-tauri/src/rdp/mod.rs @@ -76,13 +76,13 @@ struct RdpSessionHandle { } pub struct RdpService { - sessions: DashMap>, + sessions: Arc>>, } impl RdpService { pub fn new() -> Self { Self { - sessions: DashMap::new(), + sessions: Arc::new(DashMap::new()), } } diff --git a/src-tauri/src/sftp/mod.rs b/src-tauri/src/sftp/mod.rs index e8e39a6..d844668 100644 --- a/src-tauri/src/sftp/mod.rs +++ b/src-tauri/src/sftp/mod.rs @@ -99,13 +99,13 @@ pub struct SftpService { /// One `SftpSession` per SSH session, behind a mutex so async commands can /// take a shared reference to the `SftpService` and still mutably borrow /// individual sessions. - clients: DashMap>>, + clients: Arc>>>, } impl SftpService { pub fn new() -> Self { Self { - clients: DashMap::new(), + clients: Arc::new(DashMap::new()), } } diff --git a/src-tauri/src/ssh/session.rs b/src-tauri/src/ssh/session.rs index 1edff66..4e61d9a 100644 --- a/src-tauri/src/ssh/session.rs +++ b/src-tauri/src/ssh/session.rs @@ -76,13 +76,13 @@ impl client::Handler for SshClient { #[derive(Clone)] pub struct SshService { - sessions: DashMap>, + sessions: Arc>>, db: Database, } impl SshService { pub fn new(db: Database) -> Self { - Self { sessions: DashMap::new(), db } + Self { sessions: Arc::new(DashMap::new()), db } } pub async fn connect(&self, app_handle: AppHandle, hostname: &str, port: u16, username: &str, auth: AuthMethod, cols: u32, rows: u32, sftp_service: &SftpService, scrollback: &ScrollbackRegistry, error_watcher: &ErrorWatcher) -> Result {