pub struct CommWorkspace {
pub id: String,
pub name: String,
pub contexts: Vec<WorkspaceContext>,
}Expand description
A workspace holding references to multiple .acomm stores.
Fields§
§id: StringUnique workspace identifier (deterministic hash of name).
name: StringHuman-readable workspace name.
contexts: Vec<WorkspaceContext>Loaded store contexts.
Implementations§
Source§impl CommWorkspace
impl CommWorkspace
Sourcepub fn new(name: &str) -> Self
pub fn new(name: &str) -> Self
Create a new empty workspace with the given name.
The workspace ID is a deterministic SHA-256-based hex string derived from the name, giving stable identifiers across sessions.
Sourcepub fn add_context(
&mut self,
path: &str,
label: Option<&str>,
role: WorkspaceRole,
) -> Result<(), String>
pub fn add_context( &mut self, path: &str, label: Option<&str>, role: WorkspaceRole, ) -> Result<(), String>
Add a context (.acomm file) to the workspace.
Loads the store to gather statistics. Returns an error if the file cannot be loaded.
Sourcepub fn list_contexts(&self) -> &[WorkspaceContext]
pub fn list_contexts(&self) -> &[WorkspaceContext]
Return a slice of all loaded contexts.
Sourcepub fn query(
&self,
query: &str,
max_per_context: usize,
) -> Vec<WorkspaceQueryResult>
pub fn query( &self, query: &str, max_per_context: usize, ) -> Vec<WorkspaceQueryResult>
Query all contexts for the given text.
Searches messages (content), channels (name), and agents (participants)
in each loaded store. Returns up to max_per_context matches per store.
Sourcepub fn compare(&self, item: &str, max_per_context: usize) -> WorkspaceComparison
pub fn compare(&self, item: &str, max_per_context: usize) -> WorkspaceComparison
Compare the presence of an item across all contexts.
For each context, searches messages, channels, and agents for the item and reports whether it was found, how many times, and a brief summary.
Trait Implementations§
Source§impl Clone for CommWorkspace
impl Clone for CommWorkspace
Source§fn clone(&self) -> CommWorkspace
fn clone(&self) -> CommWorkspace
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more