pub trait Index: Send + Sync {
// Required methods
fn name(&self) -> &str;
fn index_type(&self) -> IndexType;
fn insert<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
value: &'life1 str,
document_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), IndexError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn remove<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
value: &'life1 str,
document_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), IndexError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
value: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>, IndexError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn values<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>, IndexError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn stats<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<IndexStats, IndexError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn clear<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), IndexError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}
Expand description
Index trait for different index implementations
Required Methods§
Sourcefn index_type(&self) -> IndexType
fn index_type(&self) -> IndexType
Get the index type
Sourcefn insert<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
value: &'life1 str,
document_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), IndexError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn insert<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
value: &'life1 str,
document_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), IndexError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Insert a value with associated document ID
Sourcefn remove<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
value: &'life1 str,
document_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), IndexError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn remove<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
value: &'life1 str,
document_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), IndexError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Remove a value-document association
Sourcefn get<'life0, 'life1, 'async_trait>(
&'life0 self,
value: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>, IndexError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
value: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>, IndexError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get document IDs for a value
Sourcefn values<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>, IndexError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn values<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>, IndexError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get all values in the index
Sourcefn stats<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<IndexStats, IndexError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn stats<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<IndexStats, IndexError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get index statistics