use std::path::{Path, PathBuf};
use arrow_array::RecordBatch;
use crate::python_sources::errors::ReadError;
use crate::python_sources::models::{PythonSource, TableRead};
#[derive(Debug)]
pub enum Streamed {
Batch(RecordBatch),
State(String),
}
pub trait BatchStream: Send {
fn next_batch(&mut self) -> Option<Result<Streamed, ReadError>>;
}
pub trait PythonHost: Send + Sync + std::fmt::Debug {
fn discover(&self, root: &Path, python_paths: &[PathBuf]) -> Result<Vec<PythonSource>, String>;
fn read_table(&self, request: &TableRead) -> Result<Box<dyn BatchStream>, String>;
fn table_state(&self, table: &str) -> Result<Option<String>, String>;
fn finish(&self);
}