use serde::{Deserialize, Serialize};
#[derive(Debug, Clone)]
pub struct RealtimeSuggestion {
pub text: String,
pub description: String,
pub category: String,
pub score: f32,
pub matched_indices: Vec<usize>,
}
impl RealtimeSuggestion {
pub fn new(text: String, description: String, category: String) -> Self {
Self {
text,
description,
category,
score: 1.0,
matched_indices: Vec::new(),
}
}
pub fn with_score(mut self, score: f32, matched_indices: Vec<usize>) -> Self {
self.score = score;
self.matched_indices = matched_indices;
self
}
}