2023-04-17 14:56:00 +02:00
|
|
|
pub mod cursor;
|
2023-07-01 13:54:34 +02:00
|
|
|
pub mod errors;
|
2023-07-30 17:48:55 +02:00
|
|
|
pub mod buffer;
|
2023-04-07 03:05:21 +02:00
|
|
|
|
2023-07-30 22:58:24 +02:00
|
|
|
pub mod state;
|
|
|
|
|
2023-04-07 03:05:21 +02:00
|
|
|
pub use tonic;
|
|
|
|
pub use tokio;
|
2023-07-02 23:59:04 +02:00
|
|
|
pub use operational_transform as ot;
|
2023-07-01 13:54:34 +02:00
|
|
|
|
2023-07-30 22:58:24 +02:00
|
|
|
#[cfg(feature = "proto")]
|
|
|
|
pub mod proto {
|
|
|
|
tonic::include_proto!("buffer");
|
|
|
|
}
|
2023-07-30 17:48:55 +02:00
|
|
|
|
2023-07-30 22:58:24 +02:00
|
|
|
pub use errors::CodempError;
|
|
|
|
|
|
|
|
#[tonic::async_trait] // TODO move this somewhere?
|
|
|
|
pub(crate) trait ControllerWorker<T> {
|
2023-07-30 17:48:55 +02:00
|
|
|
fn subscribe(&self) -> T;
|
|
|
|
async fn work(self);
|
|
|
|
}
|
|
|
|
|
2023-07-30 22:58:24 +02:00
|
|
|
#[tonic::async_trait]
|
|
|
|
pub trait Controller<T> {
|
|
|
|
async fn recv(&self) -> Result<T, CodempError>;
|
|
|
|
async fn send(&self, x: T) -> Result<(), CodempError>;
|
2023-07-30 17:48:55 +02:00
|
|
|
}
|