lance_index::scalar

Trait IndexWriter

Source
pub trait IndexWriter: Send {
    // Required methods
    fn write_record_batch<'life0, 'async_trait>(
        &'life0 mut self,
        batch: RecordBatch,
    ) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn finish<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn finish_with_metadata<'life0, 'async_trait>(
        &'life0 mut self,
        metadata: HashMap<String, String>,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Trait for storing an index (or parts of an index) into storage

Required Methods§

Source

fn write_record_batch<'life0, 'async_trait>( &'life0 mut self, batch: RecordBatch, ) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Writes a record batch into the file, returning the 0-based index of the batch in the file

E.g. if this is the third time this is called this method will return 2

Source

fn finish<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Finishes writing the file and closes the file

Source

fn finish_with_metadata<'life0, 'async_trait>( &'life0 mut self, metadata: HashMap<String, String>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Finishes writing the file and closes the file with additional metadata

Implementations on Foreign Types§

Source§

impl IndexWriter for FileWriter

Source§

fn write_record_batch<'life0, 'async_trait>( &'life0 mut self, batch: RecordBatch, ) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn finish<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn finish_with_metadata<'life0, 'async_trait>( &'life0 mut self, metadata: HashMap<String, String>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

impl<M: ManifestProvider + Send + Sync> IndexWriter for FileWriter<M>

Source§

fn write_record_batch<'life0, 'async_trait>( &'life0 mut self, batch: RecordBatch, ) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn finish<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn finish_with_metadata<'life0, 'async_trait>( &'life0 mut self, metadata: HashMap<String, String>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Implementors§