pub trait IndexPlugin: Plugin {
// Required methods
fn index_type(&self) -> &str;
fn insert(
&mut self,
key: &PropertyValue,
node_id: NodeId,
) -> Result<(), CypherLiteError>;
fn remove(
&mut self,
key: &PropertyValue,
node_id: NodeId,
) -> Result<(), CypherLiteError>;
fn lookup(
&self,
key: &PropertyValue,
) -> Result<Vec<NodeId>, CypherLiteError>;
}Expand description
A custom index implementation that can be plugged into the storage layer.
Required Methods§
Sourcefn index_type(&self) -> &str
fn index_type(&self) -> &str
Returns the identifier for this index type (e.g. "btree", "rtree").
Sourcefn insert(
&mut self,
key: &PropertyValue,
node_id: NodeId,
) -> Result<(), CypherLiteError>
fn insert( &mut self, key: &PropertyValue, node_id: NodeId, ) -> Result<(), CypherLiteError>
Insert a (key, node_id) entry into the index.
Sourcefn remove(
&mut self,
key: &PropertyValue,
node_id: NodeId,
) -> Result<(), CypherLiteError>
fn remove( &mut self, key: &PropertyValue, node_id: NodeId, ) -> Result<(), CypherLiteError>
Remove a (key, node_id) entry from the index.
Sourcefn lookup(&self, key: &PropertyValue) -> Result<Vec<NodeId>, CypherLiteError>
fn lookup(&self, key: &PropertyValue) -> Result<Vec<NodeId>, CypherLiteError>
Look up all node IDs associated with the given key.