pub struct CompletionHistory { /* private fields */ }Expand description
Completion history tracker
Implementations§
Source§impl CompletionHistory
impl CompletionHistory
Sourcepub fn with_path(history_path: PathBuf) -> Self
pub fn with_path(history_path: PathBuf) -> Self
Create a new completion history tracker with persistence
Sourcepub fn record_usage(
&self,
label: String,
language: String,
) -> CompletionResult<()>
pub fn record_usage( &self, label: String, language: String, ) -> CompletionResult<()>
Record a completion usage
Sourcepub fn get_frequency_score(
&self,
label: &str,
language: &str,
) -> CompletionResult<f32>
pub fn get_frequency_score( &self, label: &str, language: &str, ) -> CompletionResult<f32>
Get the frequency score for a completion (0.0 to 1.0)
Sourcepub fn get_recency_score(
&self,
label: &str,
language: &str,
) -> CompletionResult<f32>
pub fn get_recency_score( &self, label: &str, language: &str, ) -> CompletionResult<f32>
Get the recency score for a completion (0.0 to 1.0) Recent completions get higher scores
Sourcepub fn get_usage_score(
&self,
label: &str,
language: &str,
frequency_weight: f32,
recency_weight: f32,
) -> CompletionResult<f32>
pub fn get_usage_score( &self, label: &str, language: &str, frequency_weight: f32, recency_weight: f32, ) -> CompletionResult<f32>
Get combined frequency and recency score
Sourcepub fn load(&self) -> CompletionResult<()>
pub fn load(&self) -> CompletionResult<()>
Load history from file
Sourcepub fn save(&self) -> CompletionResult<()>
pub fn save(&self) -> CompletionResult<()>
Save history to file
Sourcepub fn clear(&self) -> CompletionResult<()>
pub fn clear(&self) -> CompletionResult<()>
Clear all history
Sourcepub fn get_all_usages(&self) -> CompletionResult<Vec<CompletionUsage>>
pub fn get_all_usages(&self) -> CompletionResult<Vec<CompletionUsage>>
Get all usage records
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CompletionHistory
impl RefUnwindSafe for CompletionHistory
impl Send for CompletionHistory
impl Sync for CompletionHistory
impl Unpin for CompletionHistory
impl UnwindSafe for CompletionHistory
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