pub struct SemanticCacheIndex {
pub entries: Vec<SemanticCacheEntry>,
pub idf: HashMap<String, f64>,
pub total_docs: usize,
}Fields§
§entries: Vec<SemanticCacheEntry>§idf: HashMap<String, f64>§total_docs: usizeImplementations§
Source§impl SemanticCacheIndex
impl SemanticCacheIndex
pub fn add_file(&mut self, path: &str, content: &str, session_id: &str)
pub fn find_similar(&self, content: &str, threshold: f64) -> Vec<(String, f64)>
pub fn suggest_warmup(&self, top_n: usize) -> Vec<String>
pub fn save(&self, project_root: &str) -> Result<(), String>
pub fn load(project_root: &str) -> Option<Self>
pub fn load_or_create(project_root: &str) -> Self
Trait Implementations§
Source§impl Clone for SemanticCacheIndex
impl Clone for SemanticCacheIndex
Source§fn clone(&self) -> SemanticCacheIndex
fn clone(&self) -> SemanticCacheIndex
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 moreSource§impl Debug for SemanticCacheIndex
impl Debug for SemanticCacheIndex
Source§impl Default for SemanticCacheIndex
impl Default for SemanticCacheIndex
Source§fn default() -> SemanticCacheIndex
fn default() -> SemanticCacheIndex
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for SemanticCacheIndex
impl<'de> Deserialize<'de> for SemanticCacheIndex
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for SemanticCacheIndex
impl RefUnwindSafe for SemanticCacheIndex
impl Send for SemanticCacheIndex
impl Sync for SemanticCacheIndex
impl Unpin for SemanticCacheIndex
impl UnsafeUnpin for SemanticCacheIndex
impl UnwindSafe for SemanticCacheIndex
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