mnemo-core 0.4.0-rc3

Core storage, data model, query engine, and indexing for Mnemo
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
pub mod tantivy_index;

use crate::error::Result;
use uuid::Uuid;

pub trait FullTextIndex: Send + Sync {
    fn add(&self, id: Uuid, content: &str) -> Result<()>;
    fn remove(&self, id: Uuid) -> Result<()>;
    fn search(&self, query: &str, limit: usize) -> Result<Vec<(Uuid, f32)>>;
    fn commit(&self) -> Result<()>;
    fn save(&self) -> Result<()>;
    fn len(&self) -> usize;
    fn is_empty(&self) -> bool {
        self.len() == 0
    }
}