pub struct WorkspaceManager { /* private fields */ }Expand description
Lock-free workspace manager
Manages all workspaces with zero blocking operations using DashMap.
Implementations§
Source§impl WorkspaceManager
impl WorkspaceManager
Sourcepub fn new() -> WorkspaceManager
pub fn new() -> WorkspaceManager
Creates a new empty workspace manager
Sourcepub fn create_workspace(&self, name: String, description: String) -> Uuid
pub fn create_workspace(&self, name: String, description: String) -> Uuid
Create a new workspace (lock-free)
Sourcepub fn restore_workspace(
&self,
id: Uuid,
name: String,
description: String,
sessions: Vec<(Uuid, SessionRole)>,
)
pub fn restore_workspace( &self, id: Uuid, name: String, description: String, sessions: Vec<(Uuid, SessionRole)>, )
Restore a workspace from storage (lock-free)
Sourcepub fn get_workspace(&self, id: &Uuid) -> Option<Arc<Workspace>>
pub fn get_workspace(&self, id: &Uuid) -> Option<Arc<Workspace>>
Get workspace by ID (lock-free)
Sourcepub fn get_workspace_by_name(&self, name: &str) -> Option<Arc<Workspace>>
pub fn get_workspace_by_name(&self, name: &str) -> Option<Arc<Workspace>>
Get workspace by name (lock-free)
Sourcepub fn list_workspaces(&self) -> Vec<Arc<Workspace>>
pub fn list_workspaces(&self) -> Vec<Arc<Workspace>>
List all workspaces (lock-free snapshot)
Sourcepub fn delete_workspace(&self, id: &Uuid) -> Option<Arc<Workspace>>
pub fn delete_workspace(&self, id: &Uuid) -> Option<Arc<Workspace>>
Delete workspace (lock-free)
Sourcepub fn add_session_to_workspace(
&self,
workspace_id: &Uuid,
session_id: Uuid,
role: SessionRole,
) -> Result<(), String>
pub fn add_session_to_workspace( &self, workspace_id: &Uuid, session_id: Uuid, role: SessionRole, ) -> Result<(), String>
Add session to workspace (lock-free)
Sourcepub fn remove_session_from_workspace(
&self,
workspace_id: &Uuid,
session_id: &Uuid,
) -> Result<Option<SessionRole>, String>
pub fn remove_session_from_workspace( &self, workspace_id: &Uuid, session_id: &Uuid, ) -> Result<Option<SessionRole>, String>
Remove session from workspace (lock-free)
Sourcepub fn total_workspaces(&self) -> u64
pub fn total_workspaces(&self) -> u64
Get total workspace count (atomic read)
Trait Implementations§
Source§impl Default for WorkspaceManager
impl Default for WorkspaceManager
Source§fn default() -> WorkspaceManager
fn default() -> WorkspaceManager
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for WorkspaceManager
impl !RefUnwindSafe for WorkspaceManager
impl Send for WorkspaceManager
impl Sync for WorkspaceManager
impl Unpin for WorkspaceManager
impl UnsafeUnpin for WorkspaceManager
impl !UnwindSafe for WorkspaceManager
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> 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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::RequestSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::RequestSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request