pub struct FunctionTrie { /* private fields */ }Expand description
High-performance prefix trie for function lookup
Implementations§
Source§impl FunctionTrie
impl FunctionTrie
Sourcepub fn get_prefix(&self, text: &str) -> Option<(String, Arc<Function>)>
pub fn get_prefix(&self, text: &str) -> Option<(String, Arc<Function>)>
Get the longest registered function name that is a prefix of text,
matching strictly from the start of text.
For example, if $ping is registered:
get_prefix("$pingmsoko")→ Some((“$ping”, …))get_prefix("$pingsmmonwind")→ Some((“$ping”, …))get_prefix("$send")→ None (no registered prefix)
The search always starts at position 0 of text; it will never match
a function name found only in the middle of the string.
Sourcepub fn get_completions(&self, prefix: &str) -> Vec<Arc<Function>>
pub fn get_completions(&self, prefix: &str) -> Vec<Arc<Function>>
Get all functions with a given prefix
Sourcepub fn all_functions(&self) -> Vec<Arc<Function>>
pub fn all_functions(&self) -> Vec<Arc<Function>>
Get all functions in the trie
Trait Implementations§
Source§impl Default for FunctionTrie
impl Default for FunctionTrie
Source§fn default() -> FunctionTrie
fn default() -> FunctionTrie
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for FunctionTrie
impl RefUnwindSafe for FunctionTrie
impl Send for FunctionTrie
impl Sync for FunctionTrie
impl Unpin for FunctionTrie
impl UnsafeUnpin for FunctionTrie
impl UnwindSafe for FunctionTrie
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