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§
Sourcefn insert(&mut self, record_id: u64, keys: Vec<String>)
fn insert(&mut self, record_id: u64, keys: Vec<String>)
Index record_id under the given set of blocking keys.
Sourcefn lookup_union(&self, keys: &[String], exclude: u64) -> Vec<u64>
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.
fn as_any(&self) -> &(dyn Any + 'static)
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".