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§
fn as_any(&self) -> &dyn Any
Sourcefn name(&self) -> &str
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”.
Sourcefn get_index_at_op(
&self,
op: &Operation,
store: &Arc<Store>,
) -> Result<Box<dyn ReadonlyIndex>, IndexReadError>
fn get_index_at_op( &self, op: &Operation, store: &Arc<Store>, ) -> Result<Box<dyn ReadonlyIndex>, IndexReadError>
Returns the index at the specified operation.
Sourcefn write_index(
&self,
index: Box<dyn MutableIndex>,
op: &Operation,
) -> Result<Box<dyn ReadonlyIndex>, IndexWriteError>
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.