pub trait Index:
Send
+ Sync
+ DeepSizeOf {
// Required methods
fn as_any(&self) -> &dyn Any;
fn as_index(self: Arc<Self>) -> Arc<dyn Index> ⓘ;
fn as_vector_index(self: Arc<Self>) -> Result<Arc<dyn VectorIndex>>;
fn statistics(&self) -> Result<Value>;
fn prewarm<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn index_type(&self) -> IndexType;
fn calculate_included_frags<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<RoaringBitmap>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Generic methods common across all types of secondary indices
Required Methods§
Sourcefn as_vector_index(self: Arc<Self>) -> Result<Arc<dyn VectorIndex>>
fn as_vector_index(self: Arc<Self>) -> Result<Arc<dyn VectorIndex>>
Cast to vector::VectorIndex
Sourcefn statistics(&self) -> Result<Value>
fn statistics(&self) -> Result<Value>
Retrieve index statistics as a JSON Value
Sourcefn prewarm<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn prewarm<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Prewarm the index.
This will load the index into memory and cache it.
Sourcefn index_type(&self) -> IndexType
fn index_type(&self) -> IndexType
Get the type of the index
Sourcefn calculate_included_frags<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<RoaringBitmap>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn calculate_included_frags<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<RoaringBitmap>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Read through the index and determine which fragment ids are covered by the index
This is a kind of slow operation. It’s better to use the fragment_bitmap. This only exists for cases where the fragment_bitmap has become corrupted or missing.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".