pub struct Workspace {
pub id: Uuid,
pub name: String,
pub description: String,
pub created_at: SystemTime,
pub session_ids: Arc<DashMap<Uuid, SessionRole>>,
pub metadata: Arc<ArcSwapAny<Arc<WorkspaceMetadata>>>,
}Expand description
A workspace groups related sessions (e.g., microservices in same ecosystem)
All operations are lock-free using DashMap and ArcSwap.
Fields§
§id: UuidUnique workspace identifier
name: StringHuman-readable workspace name
description: StringWorkspace description
created_at: SystemTimeWhen the workspace was created
session_ids: Arc<DashMap<Uuid, SessionRole>>Lock-free session tracking with roles
metadata: Arc<ArcSwapAny<Arc<WorkspaceMetadata>>>Atomic metadata updates
Implementations§
Source§impl Workspace
impl Workspace
Sourcepub fn new(id: Uuid, name: String, description: String) -> Workspace
pub fn new(id: Uuid, name: String, description: String) -> Workspace
Creates a new workspace with the given ID, name, and description
Sourcepub fn add_session(&self, session_id: Uuid, role: SessionRole)
pub fn add_session(&self, session_id: Uuid, role: SessionRole)
Add a session to this workspace (lock-free)
Sourcepub fn remove_session(&self, session_id: &Uuid) -> Option<SessionRole>
pub fn remove_session(&self, session_id: &Uuid) -> Option<SessionRole>
Remove a session from this workspace (lock-free)
Sourcepub fn get_session_role(&self, session_id: &Uuid) -> Option<SessionRole>
pub fn get_session_role(&self, session_id: &Uuid) -> Option<SessionRole>
Get role of a session (lock-free)
Sourcepub fn get_all_sessions(&self) -> Vec<(Uuid, SessionRole)>
pub fn get_all_sessions(&self) -> Vec<(Uuid, SessionRole)>
Get all session IDs (lock-free snapshot)
Sourcepub fn update_metadata<F>(&self, f: F)where
F: FnOnce(&mut WorkspaceMetadata),
pub fn update_metadata<F>(&self, f: F)where
F: FnOnce(&mut WorkspaceMetadata),
Update metadata atomically
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Workspace
impl<'de> Deserialize<'de> for Workspace
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Workspace, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Workspace, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for Workspace
impl Serialize for Workspace
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for Workspace
impl !RefUnwindSafe for Workspace
impl Send for Workspace
impl Sync for Workspace
impl Unpin for Workspace
impl UnsafeUnpin for Workspace
impl !UnwindSafe for Workspace
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 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