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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
use BTreeMap;
;
;
/// A node/edge property, as persisted to redb (via `postcard`, see
/// `encode.rs`) and used directly as MarsDB's runtime scalar type -- there
/// is no separate "wire" representation. New variants append at the end
/// (postcard's derive encodes an enum discriminant by declaration order),
/// never reorder/remove an existing one, or every already-stored property
/// silently decodes as the wrong variant.
///
/// `Date`/`Duration` are Cypher's `DATE`/`DURATION` temporal types, added
/// as first-class variants rather than reusing `Int`/`String` -- e.g.
/// stashing a date as `Int(epoch_day)` would round-trip through storage
/// fine, but a plain `Int` and a `Date` would then be indistinguishable
/// once read back (Temporal4's "store a date, read it back, it must
/// still print/compare/access-components as a date" scenarios need that
/// distinction to survive the storage boundary). `LocalTime`/`Time`/
/// `LocalDateTime`/`DateTime` (Cypher's other four temporal types) follow
/// the same reasoning below. `Time` only accepts a *fixed* UTC offset --
/// it carries no calendar date, so a named zone's DST-dependent offset
/// has nothing to resolve against; `DateTime` accepts either a fixed
/// offset or a named zone (`TzId`).
///
/// `Map` exists here for exactly one reason: a `$parameter`'s value can be
/// map-shaped (`{name: 'Apa'}`, TCK's Map2/Map3), and query-time
/// parameters flow in as `PropertyValue` (this is the one place a
/// non-storable shape has to travel through). A node/edge *property*
/// value is never actually a `Map` though -- real Cypher forbids storing
/// one (`marsdb-query::executor::value_to_storable_property` rejects it
/// outright before anything reaches `GraphStore`), so this variant is
/// only ever constructed on the parameter-passing path, never persisted.
/// A `DateTime`'s zone: a fixed UTC offset, or a named IANA timezone
/// (`Europe/Stockholm`) whose real offset varies by instant (DST) and is
/// resolved on demand, not stored -- see `PropertyValue::DateTime`'s doc
/// comment.
/// A traversal-hop candidate read directly from an adjacency multimap entry,
/// without touching the `edges`/`nodes` tables.
/// Composite-key layout for `ADJ_OUT`/`ADJ_IN` (v2 step 2):
/// `(owner_node, label_id, edge_id)` tuple key -> other node id as the
/// value. A redb tuple of fixed-width integers stays fixed-width (a
/// byte-packed `[u8; 20]` key here measured a 2x database file — the
/// mars-am7 erasure tax; see `tables::ADJ_OUT`'s docs) and orders
/// component-wise, so one node's edges are contiguous and label-typed
/// expansion is a sub-prefix range within them. `AdjEntry` stays the
/// in-memory traversal-candidate type; only its storage layout moved
/// from a 20-byte multimap *value* into this key shape.
pub type AdjKey = ;
pub
/// Inclusive key bounds covering every adjacency entry a node owns,
/// any label — the untyped-expansion prefix.
pub
/// Inclusive key bounds covering one node's entries under one label —
/// the typed-expansion prefix (`O(matching degree)`).
pub