Skip to main content

CollaborativeDoc

Trait CollaborativeDoc 

Source
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§

Source

fn id(&self) -> &str

Return the stable document identifier.

Source

fn replica_id(&self) -> &str

Return the local replica identifier that owns this document handle.

Source

fn subscribe(&self) -> Receiver<DocEvent>

Subscribe to document change events.

Subscribers receive only future events from the time of subscription.

Source

fn take_pending_deltas(&mut self) -> Vec<Vec<u8>>

Drain pending deltas to send through your sync transport.

Source

fn apply_remote(&mut self, delta: &[u8])

Apply a serialized remote delta payload.

Implementors§