use arrow_array::{Array, ArrayRef, UInt32Array};
use async_trait::async_trait;
pub mod binary;
pub mod dictionary;
pub mod plain;
use crate::ReadBatchParams;
use lance_core::Result;
#[async_trait]
pub trait Encoder {
async fn encode(&mut self, array: &[&dyn Array]) -> Result<usize>;
}
#[async_trait]
pub trait Decoder: Send + AsyncIndex<ReadBatchParams> {
async fn decode(&self) -> Result<ArrayRef>;
async fn take(&self, indices: &UInt32Array) -> Result<ArrayRef>;
}
#[async_trait]
pub trait AsyncIndex<IndexType> {
type Output: Send + Sync;
async fn get(&self, index: IndexType) -> Self::Output;
}