pub struct SharedContextManager { /* private fields */ }Expand description
Manages shared context across domain agents
This struct maintains cross-domain context that is shared between agents, enabling coordination and dependency tracking between recommendations.
§Examples
ⓘ
use ricecoder_agents::domain::SharedContextManager;
let manager = SharedContextManager::new();
manager.update_context("project_type", serde_json::json!("web-app"))?;
let value = manager.get_context("project_type")?;Implementations§
Sourcepub fn update_context(&self, key: &str, value: Value) -> DomainResult<()>
pub fn update_context(&self, key: &str, value: Value) -> DomainResult<()>
Sourcepub fn get_context(&self, key: &str) -> DomainResult<Value>
pub fn get_context(&self, key: &str) -> DomainResult<Value>
Sourcepub fn set_project_type(&self, project_type: &str) -> DomainResult<()>
pub fn set_project_type(&self, project_type: &str) -> DomainResult<()>
Sourcepub fn get_project_type(&self) -> DomainResult<String>
pub fn get_project_type(&self) -> DomainResult<String>
Get project type
Sourcepub fn add_technology(&self, technology: &str) -> DomainResult<()>
pub fn add_technology(&self, technology: &str) -> DomainResult<()>
Sourcepub fn get_tech_stack(&self) -> DomainResult<Vec<String>>
pub fn get_tech_stack(&self) -> DomainResult<Vec<String>>
Get tech stack
Sourcepub fn add_constraint(&self, constraint: &str) -> DomainResult<()>
pub fn add_constraint(&self, constraint: &str) -> DomainResult<()>
Sourcepub fn get_constraints(&self) -> DomainResult<Vec<String>>
pub fn get_constraints(&self) -> DomainResult<Vec<String>>
Get constraints
Sourcepub fn store_agent_recommendations(
&self,
agent_id: &str,
recommendations: Vec<Recommendation>,
) -> DomainResult<()>
pub fn store_agent_recommendations( &self, agent_id: &str, recommendations: Vec<Recommendation>, ) -> DomainResult<()>
Store agent recommendations
§Arguments
agent_id- Agent identifierrecommendations- Recommendations from the agent
Sourcepub fn get_agent_recommendations(
&self,
agent_id: &str,
) -> DomainResult<Vec<Recommendation>>
pub fn get_agent_recommendations( &self, agent_id: &str, ) -> DomainResult<Vec<Recommendation>>
Sourcepub fn get_all_recommendations(&self) -> DomainResult<Vec<Recommendation>>
pub fn get_all_recommendations(&self) -> DomainResult<Vec<Recommendation>>
Get all agent recommendations
Get shared context
Sourcepub fn clear(&self) -> DomainResult<()>
pub fn clear(&self) -> DomainResult<()>
Clear all context
Trait Implementations§
Source§fn clone(&self) -> SharedContextManager
fn clone(&self) -> SharedContextManager
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§
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