pub trait CollaborativeDoc {
// Required methods
fn id(&self) -> &str;
fn replica_id(&self) -> &str;
fn subscribe(&self) -> Receiver<DocEvent>;
fn take_pending_deltas(&mut self) -> Vec<Vec<u8>>;
fn apply_remote(&mut self, delta: &[u8]);
}Expand description
Trait for collaborative documents.
Required Methods§
Sourcefn replica_id(&self) -> &str
fn replica_id(&self) -> &str
Return the local replica identifier that owns this document handle.
Sourcefn subscribe(&self) -> Receiver<DocEvent>
fn subscribe(&self) -> Receiver<DocEvent>
Subscribe to document change events.
Subscribers receive only future events from the time of subscription.
Sourcefn take_pending_deltas(&mut self) -> Vec<Vec<u8>>
fn take_pending_deltas(&mut self) -> Vec<Vec<u8>>
Drain pending deltas to send through your sync transport.
Sourcefn apply_remote(&mut self, delta: &[u8])
fn apply_remote(&mut self, delta: &[u8])
Apply a serialized remote delta payload.