pub struct QuickMatchConfig { /* private fields */ }Implementations§
Source§impl QuickMatchConfig
impl QuickMatchConfig
Sourcepub fn new() -> Self
pub fn new() -> Self
Examples found in repository?
examples/colon_test.rs (line 17)
3fn main() {
4 // Case 1: Items with colon, query with colon (default separators)
5 let items = vec!["word: word2", "other: thing", "word word2"];
6 let qm = QuickMatch::new(&items);
7 let results = qm.matches("word: word2");
8 println!("Default seps | query 'word: word2' vs items with colon: {results:?}");
9
10 // Case 2: Query "word:" against items
11 let items2 = vec!["word: word2", "word word2", "word", "word:"];
12 let qm2 = QuickMatch::new(&items2);
13 let results2 = qm2.matches("word:");
14 println!("Default seps | query 'word:' vs mixed items: {results2:?}");
15
16 // Case 3: Colon as separator, query "word: word2"
17 let config3 = QuickMatchConfig::new().with_separators(&['_', '-', ' ', ':']);
18 let items3 = vec!["word: word2", "other: thing", "word word2"];
19 let qm3 = QuickMatch::new_with(&items3, config3);
20 let results3 = qm3.matches("word: word2");
21 println!("Colon as sep | query 'word: word2': {results3:?}");
22
23 // Case 4: Colon as separator, query "word:"
24 let config4 = QuickMatchConfig::new().with_separators(&['_', '-', ' ', ':']);
25 let items4 = vec!["word: word2", "word word2", "word", "word:"];
26 let qm4 = QuickMatch::new_with(&items4, config4);
27 let results4 = qm4.matches("word:");
28 println!("Colon as sep | query 'word:' vs mixed items: {results4:?}");
29}pub fn with_limit(self, limit: usize) -> Self
pub fn with_trigram_budget(self, trigram_budget: usize) -> Self
Sourcepub fn with_separators(self, separators: &'static [char]) -> Self
pub fn with_separators(self, separators: &'static [char]) -> Self
Examples found in repository?
examples/colon_test.rs (line 17)
3fn main() {
4 // Case 1: Items with colon, query with colon (default separators)
5 let items = vec!["word: word2", "other: thing", "word word2"];
6 let qm = QuickMatch::new(&items);
7 let results = qm.matches("word: word2");
8 println!("Default seps | query 'word: word2' vs items with colon: {results:?}");
9
10 // Case 2: Query "word:" against items
11 let items2 = vec!["word: word2", "word word2", "word", "word:"];
12 let qm2 = QuickMatch::new(&items2);
13 let results2 = qm2.matches("word:");
14 println!("Default seps | query 'word:' vs mixed items: {results2:?}");
15
16 // Case 3: Colon as separator, query "word: word2"
17 let config3 = QuickMatchConfig::new().with_separators(&['_', '-', ' ', ':']);
18 let items3 = vec!["word: word2", "other: thing", "word word2"];
19 let qm3 = QuickMatch::new_with(&items3, config3);
20 let results3 = qm3.matches("word: word2");
21 println!("Colon as sep | query 'word: word2': {results3:?}");
22
23 // Case 4: Colon as separator, query "word:"
24 let config4 = QuickMatchConfig::new().with_separators(&['_', '-', ' ', ':']);
25 let items4 = vec!["word: word2", "word word2", "word", "word:"];
26 let qm4 = QuickMatch::new_with(&items4, config4);
27 let results4 = qm4.matches("word:");
28 println!("Colon as sep | query 'word:' vs mixed items: {results4:?}");
29}pub fn with_min_score(self, min_score: usize) -> Self
pub fn limit(&self) -> usize
pub fn trigram_budget(&self) -> usize
pub fn separators(&self) -> &[char]
pub fn min_score(&self) -> usize
Trait Implementations§
Auto Trait Implementations§
impl Freeze for QuickMatchConfig
impl RefUnwindSafe for QuickMatchConfig
impl Send for QuickMatchConfig
impl Sync for QuickMatchConfig
impl Unpin for QuickMatchConfig
impl UnsafeUnpin for QuickMatchConfig
impl UnwindSafe for QuickMatchConfig
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