pub struct WebSocketState {
pub mcp_connections: Arc<RwLock<HashMap<String, McpConnection>>>,
pub ui_connections: Arc<RwLock<Vec<UiConnection>>>,
}Expand description
Shared WebSocket state
Fields§
§mcp_connections: Arc<RwLock<HashMap<String, McpConnection>>>Project path → MCP connection
ui_connections: Arc<RwLock<Vec<UiConnection>>>List of active UI connections
Implementations§
Source§impl WebSocketState
impl WebSocketState
pub fn new() -> Self
Sourcepub async fn broadcast_to_ui(&self, message: &str)
pub async fn broadcast_to_ui(&self, message: &str)
Broadcast message to all UI connections
Sourcepub async fn get_online_projects(&self) -> Vec<ProjectInfo>
pub async fn get_online_projects(&self) -> Vec<ProjectInfo>
Get list of all online projects from in-memory state
Sourcepub async fn get_online_projects_with_current(
&self,
current_project_name: &str,
current_project_path: &Path,
current_db_path: &Path,
host_project: &ProjectInfo,
_port: u16,
) -> Vec<ProjectInfo>
pub async fn get_online_projects_with_current( &self, current_project_name: &str, current_project_path: &Path, current_db_path: &Path, host_project: &ProjectInfo, _port: u16, ) -> Vec<ProjectInfo>
Get list of all online projects Always includes the current Dashboard project plus all MCP-connected projects This is the single source of truth for project status
Trait Implementations§
Source§impl Clone for WebSocketState
impl Clone for WebSocketState
Source§fn clone(&self) -> WebSocketState
fn clone(&self) -> WebSocketState
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for WebSocketState
impl !RefUnwindSafe for WebSocketState
impl Send for WebSocketState
impl Sync for WebSocketState
impl Unpin for WebSocketState
impl !UnwindSafe for WebSocketState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more