Skip to main content

BlockIndex

Trait BlockIndex 

Source
pub trait BlockIndex: Send + Sync {
    // Required methods
    fn insert(&mut self, record_id: RecordId, keys: Vec<String>);
    fn lookup_union(&self, keys: &[String], exclude: RecordId) -> Vec<RecordId> ;
    fn remove(&mut self, record_id: RecordId);
    fn as_any(&self) -> &dyn Any;
    fn as_any_mut(&mut self) -> &mut dyn Any;
}
Expand description

Opaque blocking index.

The as_any / as_any_mut escape hatches allow access to concrete fields not covered by the trait, such as index statistics.

Required Methods§

Source

fn insert(&mut self, record_id: RecordId, keys: Vec<String>)

Index record_id under the given set of blocking keys.

Source

fn lookup_union(&self, keys: &[String], exclude: RecordId) -> Vec<RecordId>

Return all record IDs sharing at least one key with keys, excluding exclude (the querying record itself). Result must be deduplicated.

Source

fn remove(&mut self, record_id: RecordId)

Remove all index entries for record_id.

Source

fn as_any(&self) -> &dyn Any

Source

fn as_any_mut(&mut self) -> &mut dyn Any

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§