Skip to main content

IndexHandle

Trait IndexHandle 

Source
pub trait IndexHandle: Send + Sync {
    // Required methods
    fn probe(
        &self,
        query: &RecordBatch,
        k: usize,
    ) -> Result<RecordBatch, FnError>;
    fn persist(&self) -> Result<Vec<u8>, FnError>;
    fn schema(&self) -> SchemaRef;

    // Provided methods
    fn supports_filter(&self) -> bool { ... }
    fn probe_filtered(
        &self,
        _query: &RecordBatch,
        _k: usize,
        _filter: &BooleanArray,
    ) -> Result<RecordBatch, FnError> { ... }
}
Expand description

Queryable, persistable index handle (read side).

Required Methods§

Source

fn probe(&self, query: &RecordBatch, k: usize) -> Result<RecordBatch, FnError>

Probe the index with query and return up to k matches.

§Errors

Returns FnError on probe failure.

Source

fn persist(&self) -> Result<Vec<u8>, FnError>

Serialize this index for persistence.

§Errors

Returns FnError if serialization fails.

Source

fn schema(&self) -> SchemaRef

Output schema of probe / probe_filtered.

Provided Methods§

Source

fn supports_filter(&self) -> bool

Whether this index supports per-probe filter pushdown.

Source

fn probe_filtered( &self, _query: &RecordBatch, _k: usize, _filter: &BooleanArray, ) -> Result<RecordBatch, FnError>

Probe with a row-level filter applied.

§Errors

Returns FnError if filtered probe is unsupported or fails.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§