This library is an extension over Yjs/Yrs Conflict-Free Replicated Data Types (CRDT) message exchange protocol. It provides an utilities connect with Yjs web socket provider using Rust tokio's warp web server.
```rust
async fn main() { // We're using a single static document shared among all the peers. let awareness = Arc::new(RwLock::new(Awareness::new(Doc::new())));
let ws = warp::path("my-room")
.and(warp::ws())
.and(warp::any().map(move || awareness.clone()))
.and_then(ws_handler);
warp::serve(ws).run(([0, 0, 0, 0], 8000)).await;
}
async fn wshandler(ws: Ws, awareness: Arc
async fn peer(socket: WebSocket, awareness: Arc
A working demo can be seen under examples subfolder. It integrates this library API with Code Mirror 6, enhancing it with collaborative rich text document editing capabilities.