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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
//! Where a walk resumes, per source and per stream.
//!
//! This is the inside of the engine's own [`PageToken`](crate::PageToken), and nothing
//! outside this crate names it. A source's [`Cursor`] passes through untouched — the
//! engine stores one and hands it back, exactly as a plugin stores nothing of the
//! engine's page token.
//!
//! The `skip` beside the cursor is the engine counting **its own** rows, never
//! interpreting the source's. It exists because compensation narrows a source page in
//! memory: a page of 50 that yields 7 surviving rows, of which the caller's page had
//! room for 3, has to resume at "the page beginning at this cursor, four surviving rows
//! in". The alternative would be holding the other four somewhere between calls, which
//! is exactly the caching this product does not do.
use ;
use ;
/// Which of a source's streams a state addresses.
///
/// A verb reads one stream per source, except `search --kind both`, which reads two —
/// so the key is the pair rather than the source alone.
pub
/// The place one walk of one stream picks up from.
pub
/// A page token's whole document: the query it was minted for, and where each of that
/// query's streams picks up.
///
/// The query is here because every cursor below is an offset into *one* result set. Hand
/// them to a different query — the same verb with a different `--label`, a different
/// `--search`, a different `--direction` — and each source resumes at a position that
/// meant something in a walk the caller is no longer doing. The rows that come back are
/// real rows and the exit code is zero, so nothing about the answer says it is arbitrary.
/// That is the same failure the stream-kind check refuses, one layer in.
pub
/// Which stream hands back the next row when a page boundary falls mid-round.
///
/// A page of three rows over two streams ends having taken two from the first and one
/// from the second, with the second's turn still owed. Without this the next page would
/// begin its rounds at the first stream again, and the walk as a whole would stop
/// alternating — every row would still come back exactly once, but not in the order this
/// product documents, and the order would depend on the page size the caller chose.
///
/// Named by stream rather than by position, because a stream the previous page exhausted
/// is not in the next one and every position after it would shift.
pub
/// One stream's place, as the page token carries it.
pub
/// Keeps a token that resumes at the beginning of a stream down to its source and kind.