1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
//! Conflict-free collaborative editing (issue #1806).
//!
//! Mark a model's text field `#[collaborative]` and its column holds a
//! [`CollabText`] — a text CRDT whose concurrent edits merge character by
//! character instead of clobbering each other. The merge is server
//! authoritative, deterministic and in-process: no external real-time
//! service, and no new dependency.
//!
//! # The layers
//!
//! - [`text`] — the merge. [`CollabText`] is a Replicated Growable Array;
//! replicas that hold the same operations render the same text, in any
//! delivery order.
//! - [`hub`] — the session. [`CollabHub`] keeps one live document per field
//! instance, streams operations to every editor over
//! [`Channels`](crate::channels::Channels), and reports who is editing and
//! where their cursor is through [`Presence`](crate::presence::Presence).
//! Needs the `presence` feature.
//! - [`resolver`] — the offline path. [`CollabResolver`] replaces
//! last-write-wins for collaborative fields in the offline-sync engine, so
//! an edit made offline merges on reconnect. Needs the `offline-sync`
//! feature.
//! - [`registry`] — which columns hold a document, for surfaces with no
//! compile-time view of the model.
//!
//! # Declaring a field
//!
//! ```rust,ignore
//! #[autumn_web::model(table = "notes")]
//! pub struct Note {
//! #[id]
//! pub id: i64,
//! #[collaborative]
//! pub body: autumn_web::collab::CollabText,
//! }
//! ```
//!
//! The macro generates `body_text()`, `body_insert(..)`, `body_remove(..)`,
//! `body_set_text(..)` and `body_merge(..)` on the model, plus the
//! field-name-keyed `collaborative(..)` accessors.
//!
//! See `docs/guide/collaboration.md` for the walkthrough and
//! `examples/collab-notes` for a runnable app.
pub use ;
pub use ;
pub use ;
pub use CollabResolver;