Expand description
MDCS SDK - High-level SDK for building collaborative applications
This SDK provides a simple, ergonomic API for building real-time collaborative applications using the MDCS (Merkle-Delta CRDT Store).
§Quick Start
use mdcs_sdk::{Client, ClientConfig};
// Create a client with a unique replica ID
let config = ClientConfig {
user_name: "Alice".to_string(),
..Default::default()
};
let client = Client::new_with_memory_transport(config);
// Create a collaborative session
let session = client.create_session("my-session");
// Open a text document
let doc = session.open_text_doc("meeting-notes");
// Edit the document
doc.write().insert(0, "# Meeting Notes\n");
// Read the content
let content = doc.read().get_text();§Architecture
The SDK is organized into several modules:
client- Main entry point for creating and managing collaborative sessionsdocument- Document types (text, rich text, JSON)presence- Real-time cursor and user presencesync- Network synchronization and peer managementnetwork- Network transport abstractionssession- Session management for collaborative editingerror- Error types
Re-exports§
pub use client::Client;pub use client::ClientConfig;pub use client::ClientConfigBuilder;pub use document::CollaborativeDoc;pub use document::DocEvent;pub use document::JsonDoc;pub use document::RichTextDoc;pub use document::TextDoc;pub use error::Result;pub use error::SdkError;pub use network::MemoryTransport;pub use network::Message;pub use network::NetworkTransport;pub use network::Peer;pub use network::PeerId;pub use network::PeerState;pub use presence::Awareness;pub use presence::AwarenessEvent;pub use presence::CursorInfo;pub use presence::UserPresenceInfo;pub use session::Session;pub use session::SessionEvent;pub use sync::SyncConfig;pub use sync::SyncConfigBuilder;pub use sync::SyncEvent;pub use sync::SyncManager;
Modules§
- client
- High-level client for the MDCS SDK.
- document
- Document wrappers for collaborative editing.
- error
- Error types for the MDCS SDK.
- network
- Network transport abstractions for MDCS synchronization.
- prelude
- Prelude module for convenient imports.
- presence
- Presence and awareness for collaborative editing.
- session
- Session management for collaborative editing sessions.
- sync
- Synchronization primitives for the SDK.
Structs§
- Cursor
- A cursor position in a document.
- Json
Path - A path into a JSON document.
- UserId
- Unique identifier for a user.
- User
Info - User information for display.
Enums§
- Json
Value - A JSON value that can be stored in the CRDT.
- Mark
Type - The type/style of a formatting mark.
- User
Status - User status.