pub struct Cedar { /* private fields */ }
Expand description
Cedar
holds all of the information about double array trie.
Implementations
sourceimpl Cedar
impl Cedar
sourcepub fn build(&mut self, key_values: &[(&str, i32)])
pub fn build(&mut self, key_values: &[(&str, i32)])
Build the double array trie from the given key value pairs
sourcepub fn update(&mut self, key: &str, value: i32)
pub fn update(&mut self, key: &str, value: i32)
Update the key for the value, it is public interface that works on &str
sourcepub fn erase(&mut self, key: &str)
pub fn erase(&mut self, key: &str)
Delete the key from the trie, the public interface that works on &str
sourcepub fn exact_match_search(&self, key: &str) -> Option<(i32, usize, usize)>
pub fn exact_match_search(&self, key: &str) -> Option<(i32, usize, usize)>
To check if key
is in the dictionary.
sourcepub fn common_prefix_iter<'a>(&'a self, key: &'a str) -> PrefixIter<'a>ⓘNotable traits for PrefixIter<'a>impl<'a> Iterator for PrefixIter<'a> type Item = (i32, usize);
pub fn common_prefix_iter<'a>(&'a self, key: &'a str) -> PrefixIter<'a>ⓘNotable traits for PrefixIter<'a>impl<'a> Iterator for PrefixIter<'a> type Item = (i32, usize);
To return an iterator to iterate through the common prefix in the dictionary with the key
passed in.
sourcepub fn common_prefix_search(&self, key: &str) -> Option<Vec<(i32, usize)>>
pub fn common_prefix_search(&self, key: &str) -> Option<Vec<(i32, usize)>>
To return the collection of the common prefix in the dictionary with the key
passed in.
sourcepub fn common_prefix_predict_iter<'a>(
&'a self,
key: &'a str
) -> PrefixPredictIter<'a>ⓘNotable traits for PrefixPredictIter<'a>impl<'a> Iterator for PrefixPredictIter<'a> type Item = (i32, usize);
pub fn common_prefix_predict_iter<'a>(
&'a self,
key: &'a str
) -> PrefixPredictIter<'a>ⓘNotable traits for PrefixPredictIter<'a>impl<'a> Iterator for PrefixPredictIter<'a> type Item = (i32, usize);
To return an iterator to iterate through the list of words in the dictionary that has key
as their prefix.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Cedar
impl Send for Cedar
impl Sync for Cedar
impl Unpin for Cedar
impl UnwindSafe for Cedar
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more