Skip to main content

IndexPlugin

Trait IndexPlugin 

Source
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§

Source

fn index_type(&self) -> &str

Returns the identifier for this index type (e.g. "btree", "rtree").

Source

fn insert( &mut self, key: &PropertyValue, node_id: NodeId, ) -> Result<(), CypherLiteError>

Insert a (key, node_id) entry into the index.

Source

fn remove( &mut self, key: &PropertyValue, node_id: NodeId, ) -> Result<(), CypherLiteError>

Remove a (key, node_id) entry from the index.

Source

fn lookup(&self, key: &PropertyValue) -> Result<Vec<NodeId>, CypherLiteError>

Look up all node IDs associated with the given key.

Implementors§