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
71
72
73
74
75
76
77
78
79
80
81
//! Compile-time `Send`/`Sync` contract for the public API (#695).
//!
//! These assertions encode the thread-safety table in
//! `docs/api-compatibility.md` §5. They compile to nothing, but a regression
//! (e.g. adding a `Rc`/`Cell` field to a type documented as `Send + Sync`)
//! makes this test file fail to compile — turning the documented contract into
//! an enforced one.
/// Owned, shareable data model and its re-exports.
/// Borrowed page handle: `Send + Sync` for any borrow lifetime.
/// Pixel buffers and render parameters are plain owned data.
/// Parsed content models.
/// Error types must cross thread boundaries (they routinely travel out of
/// `spawn_blocking`/rayon closures).
/// The mutable editor is `Send` (it can move between threads); its borrowed
/// `PageMut` enforces exclusivity via `&mut`, so `Send` is the guarantee we
/// document, not `Sync` sharing.
/// The async lazy document inherits thread-safety from the caller-supplied
/// reader `R`: it is `Send + Sync` whenever `R` is. Proven generically so the
/// assertion does not pin a concrete reader type.