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
82
//! Text output: the boundary every renderer writes its fragments to.
//!
//! A renderer produces many small fragments (a quote, a field, a comma) and
//! must never hold a whole document. [`TextOut`] is the boundary: a
//! fragment in, a failure out. [`JoinOut`] is a text output that also
//! knows logical items, the shape a join answers. The writers and the text
//! combinators that implement them (render's `WriteOut`, `Join`,
//! `ReplaceText`) are render's, and alchemy reaches them through
//! [`Renderers`](crate::shared::Renderers).
use crateFail;
/// A consumer of text fragments.
///
/// Fragments arrive in order and are concatenated; where the boundaries
/// fall carries no meaning. `flush` pushes everything held so far to the
/// final destination, and a renderer calls it exactly once, at the end of
/// the protocol it renders, so that a document that failed half way is not
/// flushed as if it were whole.
/// A [`TextOut`] that writes a separator between logical items: what
/// [`Renderers::join`](crate::shared::Renderers::join) answers.
///
/// An item is what lies between [`JoinOut::item_start`] and
/// [`JoinOut::item_end`]; it may be written in any number of fragments, or
/// in none, and an empty item is still an item. A fragment written outside
/// an item is an item of its own. The separator goes before every item but
/// the first, never between the fragments of one item.