pub struct KnowledgeBase { /* private fields */ }Expand description
Simple keyword-scored knowledge base.
Implementations§
Source§impl KnowledgeBase
impl KnowledgeBase
pub fn new() -> Self
Sourcepub fn add_tagged(&mut self, id: &str, text: &str, tags: &[&str])
pub fn add_tagged(&mut self, id: &str, text: &str, tags: &[&str])
Add with tags.
pub fn get(&self, id: &str) -> Option<&Entry>
pub fn remove(&mut self, id: &str) -> Option<Entry>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl Freeze for KnowledgeBase
impl RefUnwindSafe for KnowledgeBase
impl Send for KnowledgeBase
impl Sync for KnowledgeBase
impl Unpin for KnowledgeBase
impl UnsafeUnpin for KnowledgeBase
impl UnwindSafe for KnowledgeBase
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