Skip to main content

IndexKindProvider

Trait IndexKindProvider 

Source
pub trait IndexKindProvider: Send + Sync {
    // Required methods
    fn kind(&self) -> IndexKind;
    fn build(
        &self,
        source: &RecordBatch,
        options: &str,
    ) -> Result<Box<dyn IndexBuild>, FnError>;
    fn open(&self, persisted: &[u8]) -> Result<Box<dyn IndexHandle>, FnError>;
}
Expand description

An index-kind provider that knows how to build / open / probe / persist a custom index.

Required Methods§

Source

fn kind(&self) -> IndexKind

The index kind this provider implements.

Source

fn build( &self, source: &RecordBatch, options: &str, ) -> Result<Box<dyn IndexBuild>, FnError>

Build a new index from a source record batch.

options is free-form JSON configuration.

§Errors

Returns FnError on build failure (out of memory, bad configuration).

Source

fn open(&self, persisted: &[u8]) -> Result<Box<dyn IndexHandle>, FnError>

Open an index from previously-persisted bytes.

§Errors

Returns FnError if the bytes are malformed or incompatible.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§