pub struct KeywordRouter { /* private fields */ }Expand description
Maps keywords to capabilities
Implementations§
Source§impl KeywordRouter
impl KeywordRouter
Sourcepub fn with_mappings(mappings: Vec<(Vec<String>, Capability, u32)>) -> Self
pub fn with_mappings(mappings: Vec<(Vec<String>, Capability, u32)>) -> Self
Create with custom mappings
Sourcepub fn extract_capabilities(&self, text: &str) -> Vec<Capability>
pub fn extract_capabilities(&self, text: &str) -> Vec<Capability>
Extract capabilities from text
Sourcepub fn has_keywords(&self, text: &str) -> bool
pub fn has_keywords(&self, text: &str) -> bool
Check if text contains any capability-indicating keywords
Trait Implementations§
Source§impl Clone for KeywordRouter
impl Clone for KeywordRouter
Source§fn clone(&self) -> KeywordRouter
fn clone(&self) -> KeywordRouter
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for KeywordRouter
impl Debug for KeywordRouter
Auto Trait Implementations§
impl Freeze for KeywordRouter
impl RefUnwindSafe for KeywordRouter
impl Send for KeywordRouter
impl Sync for KeywordRouter
impl Unpin for KeywordRouter
impl UnsafeUnpin for KeywordRouter
impl UnwindSafe for KeywordRouter
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