Trait IndexStore

Source
pub trait IndexStore:
    Send
    + Sync
    + Debug {
    // Required methods
    fn as_any(&self) -> &dyn Any;
    fn name(&self) -> &str;
    fn get_index_at_op(
        &self,
        op: &Operation,
        store: &Arc<Store>,
    ) -> Result<Box<dyn ReadonlyIndex>, IndexReadError>;
    fn write_index(
        &self,
        index: Box<dyn MutableIndex>,
        op: &Operation,
    ) -> Result<Box<dyn ReadonlyIndex>, IndexWriteError>;
}
Expand description

Defines the interface for types that provide persistent storage for an index.

Required Methods§

Source

fn as_any(&self) -> &dyn Any

Source

fn name(&self) -> &str

Returns a name representing the type of index that the IndexStore is compatible with. For example, the IndexStore for the default index returns “default”.

Source

fn get_index_at_op( &self, op: &Operation, store: &Arc<Store>, ) -> Result<Box<dyn ReadonlyIndex>, IndexReadError>

Returns the index at the specified operation.

Source

fn write_index( &self, index: Box<dyn MutableIndex>, op: &Operation, ) -> Result<Box<dyn ReadonlyIndex>, IndexWriteError>

Writes index to the index store and returns a read-only version of the index.

Implementors§