Skip to main content

BlockIndex

Trait BlockIndex 

Source
pub trait BlockIndex: Send + Sync {
    // Required methods
    fn insert(&mut self, record_id: u64, keys: Vec<String>);
    fn lookup_union(&self, keys: &[String], exclude: u64) -> Vec<u64>;
    fn remove(&mut self, record_id: u64);
    fn as_any(&self) -> &(dyn Any + 'static);
    fn as_any_mut(&mut self) -> &mut (dyn Any + 'static);
}
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: u64, keys: Vec<String>)

Index record_id under the given set of blocking keys.

Source

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

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: u64)

Remove all index entries for record_id.

Source

fn as_any(&self) -> &(dyn Any + 'static)

Source

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§