pub mod cursor; pub mod errors; pub mod buffer; pub mod client; #[cfg(feature = "static")] pub mod instance; pub use tonic; pub use tokio; pub use operational_transform as ot; #[cfg(feature = "proto")] #[allow(non_snake_case)] pub mod proto { tonic::include_proto!("codemp.buffer"); tonic::include_proto!("codemp.cursor"); } pub use errors::CodempError; #[tonic::async_trait] // TODO move this somewhere? pub(crate) trait ControllerWorker { type Controller : Controller; type Tx; type Rx; fn subscribe(&self) -> Self::Controller; async fn work(self, tx: Self::Tx, rx: Self::Rx); } #[tonic::async_trait] pub trait Controller { type Input; async fn send(&self, x: Self::Input) -> Result<(), CodempError>; async fn recv(&self) -> Result; }