pub enum StorageValue {
Take {
size: u32,
bound: Option<OwnedRow>,
},
Bound(OwnedRow),
Cap {
size: u32,
pks: Vec<Box<str>>,
},
Reduce {
count: i64,
accs: Vec<ReduceAcc>,
},
}Expand description
The value stored in operator scratch state. A tight enum, not generic
JSON: the only writers are Take and Cap (spec 10 §1.3), and their
payloads are known. This (a) keeps serde_json out of the wasm client,
(b) makes every value a flat, cheaply-clonable struct instead of a heap JSON
tree, and (c) gives operators type-safe state instead of the JS
storage as TakeStorage casts (take.ts:78).
No PartialEq. It carries OwnedRows (crate::value::OwnedValue
deliberately has no PartialEq — you must choose compare_values vs
values_equal), so comparison is spelled out where needed (tests compare via
compare_values, mirroring graph::CollectedChange).
Borrowed and owned forms coincide for this enum (no &str fields — bound is
already an OwnedRow, pks are Box<str>), so OwnedStorageValue is just
an alias; it leaves room for a future borrowed set form (spec 10 §4.2).
Variants§
Take
take.ts TakeState: a count + an optional boundary row. bound is an
OwnedRow because it outlives the cursor that produced it (foundations
§3.3 — operator-buffered state).
Bound(OwnedRow)
take.ts MAX_BOUND_KEY slot: a bare boundary row.
Cap
cap.ts CapState: a count + the membership pk-set (each pk
pre-serialized to a string exactly as JS serializePK, cap.ts:315).
Reduce
op/reduce.rs accumulator (REDUCE-DESIGN.md §5). count is the running row
count backing count(*) (birth/death is driven by it, NULLs included). accs
holds one ReduceAcc per Sum/Avg aggregate in output-column order (empty for
a plain count), so a Remove never re-reads the inputs.
Trait Implementations§
Source§impl Clone for StorageValue
impl Clone for StorageValue
Source§fn clone(&self) -> StorageValue
fn clone(&self) -> StorageValue
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more