pub struct ProjectMemory {
pub entities: HashMap<String, CodeEntity>,
pub relationships: Vec<Relationship>,
pub file_hashes: HashMap<String, String>,
pub project_path: String,
}Expand description
Core project memory that holds the knowledge graph
Fields§
§entities: HashMap<String, CodeEntity>§relationships: Vec<Relationship>§file_hashes: HashMap<String, String>§project_path: StringImplementations§
Source§impl ProjectMemory
impl ProjectMemory
pub fn new(project_path: String) -> Self
Sourcepub fn add_entity(&mut self, entity: CodeEntity)
pub fn add_entity(&mut self, entity: CodeEntity)
Add or update a code entity
Sourcepub fn remove_entity(&mut self, entity_id: &str)
pub fn remove_entity(&mut self, entity_id: &str)
Remove an entity and all its relationships
Sourcepub fn add_relationship(&mut self, relationship: Relationship)
pub fn add_relationship(&mut self, relationship: Relationship)
Add a relationship between entities
Sourcepub fn find_entities_by_name(&self, pattern: &str) -> Vec<&CodeEntity>
pub fn find_entities_by_name(&self, pattern: &str) -> Vec<&CodeEntity>
Find entities by name pattern
Sourcepub fn find_entities_in_file(&self, file_path: &str) -> Vec<&CodeEntity>
pub fn find_entities_in_file(&self, file_path: &str) -> Vec<&CodeEntity>
Find entities in a specific file
Sourcepub fn find_relationships(
&self,
query: &RelationshipQuery,
) -> Vec<&Relationship>
pub fn find_relationships( &self, query: &RelationshipQuery, ) -> Vec<&Relationship>
Find relationships matching a query
Sourcepub fn get_dependencies(&self, entity_id: &str) -> Vec<&CodeEntity>
pub fn get_dependencies(&self, entity_id: &str) -> Vec<&CodeEntity>
Get all entities that a given entity calls/uses
Sourcepub fn get_dependents(&self, entity_id: &str) -> Vec<&CodeEntity>
pub fn get_dependents(&self, entity_id: &str) -> Vec<&CodeEntity>
Get all entities that call/use a given entity
Sourcepub fn update_file_hash(&mut self, file_path: String, hash: String)
pub fn update_file_hash(&mut self, file_path: String, hash: String)
Update file hash for change detection
Sourcepub fn has_file_changed(&self, file_path: &str, current_hash: &str) -> bool
pub fn has_file_changed(&self, file_path: &str, current_hash: &str) -> bool
Check if file has changed
Sourcepub fn get_stats(&self) -> MemoryStats
pub fn get_stats(&self) -> MemoryStats
Get memory statistics
Trait Implementations§
Source§impl Clone for ProjectMemory
impl Clone for ProjectMemory
Auto Trait Implementations§
impl Freeze for ProjectMemory
impl RefUnwindSafe for ProjectMemory
impl Send for ProjectMemory
impl Sync for ProjectMemory
impl Unpin for ProjectMemory
impl UnsafeUnpin for ProjectMemory
impl UnwindSafe for ProjectMemory
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