pub struct JsonDoc { /* private fields */ }Expand description
A collaborative JSON document.
Implementations§
Source§impl JsonDoc
impl JsonDoc
Sourcepub fn new(id: impl Into<String>, replica_id: impl Into<String>) -> Self
pub fn new(id: impl Into<String>, replica_id: impl Into<String>) -> Self
Create a new JSON document.
Sourcepub fn merge(&mut self, other: &JsonDoc)
pub fn merge(&mut self, other: &JsonDoc)
Merge another document’s state into this one (CRDT merge). This applies changes from the other document while preserving local changes.
Sourcepub fn clone_state(&self) -> JsonDoc
pub fn clone_state(&self) -> JsonDoc
Clone this document’s state for syncing to another replica.
Trait Implementations§
Source§impl CollaborativeDoc for JsonDoc
impl CollaborativeDoc for JsonDoc
Source§fn replica_id(&self) -> &str
fn replica_id(&self) -> &str
Get the replica ID.
Source§fn apply_remote(&mut self, _delta: &[u8])
fn apply_remote(&mut self, _delta: &[u8])
Apply a remote delta.
Auto Trait Implementations§
impl Freeze for JsonDoc
impl !RefUnwindSafe for JsonDoc
impl Send for JsonDoc
impl Sync for JsonDoc
impl Unpin for JsonDoc
impl !UnwindSafe for JsonDoc
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more