pub struct ContextCorrelator { /* private fields */ }Expand description
The main context correlation engine for memory bank workspaces
This structure manages the discovery, parsing, and correlation of workspace context across multiple sub-projects within a memory bank structure.
Implementations§
Source§impl ContextCorrelator
impl ContextCorrelator
Sourcepub fn discover_and_correlate(
&mut self,
root_path: &Path,
) -> FsResult<&WorkspaceContext>
pub fn discover_and_correlate( &mut self, root_path: &Path, ) -> FsResult<&WorkspaceContext>
Discover and correlate workspace context from a given root path
This is the primary entry point for context correlation. It discovers the memory bank structure, parses relevant content, and builds a comprehensive workspace context.
§Arguments
root_path- Root path to search for memory bank structure
§Returns
Ok(WorkspaceContext)- Complete correlated workspace contextErr(FsError)- Discovery or parsing errors
§Example
use airs_memspec::parser::context::ContextCorrelator;
use std::path::PathBuf;
let mut correlator = ContextCorrelator::new();
let context = correlator.discover_and_correlate(&PathBuf::from("."))?;
println!("Found {} sub-projects", context.sub_project_contexts.len());Sourcepub fn get_workspace_context(&self) -> Option<&WorkspaceContext>
pub fn get_workspace_context(&self) -> Option<&WorkspaceContext>
Get the current workspace context
Returns the cached workspace context if available, or None if context correlation has not been performed yet.
§Returns
Option<&WorkspaceContext>- Current workspace context
Sourcepub fn switch_context(
&mut self,
sub_project_name: &str,
switched_by: &str,
) -> FsResult<()>
pub fn switch_context( &mut self, sub_project_name: &str, switched_by: &str, ) -> FsResult<()>
Switch to a different sub-project context
Updates the current context to point to a different sub-project and updates the current_context.md file accordingly.
§Arguments
sub_project_name- Name of the sub-project to switch toswitched_by- Identifier for who/what triggered the switch
§Returns
Ok(())- Context switch successfulErr(FsError)- File update or validation errors
Sourcepub fn get_task_summary(&self, sub_project: Option<&str>) -> Option<TaskSummary>
pub fn get_task_summary(&self, sub_project: Option<&str>) -> Option<TaskSummary>
Trait Implementations§
Source§impl Debug for ContextCorrelator
impl Debug for ContextCorrelator
Auto Trait Implementations§
impl Freeze for ContextCorrelator
impl RefUnwindSafe for ContextCorrelator
impl Send for ContextCorrelator
impl Sync for ContextCorrelator
impl Unpin for ContextCorrelator
impl UnwindSafe for ContextCorrelator
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