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
//! JSON decoding for a state field whose concrete payload is `Vec<f64>`.
//!
//! [`JsonVecF64Decoder`] converts exactly one raw JSON field value into an owned
//! vector of double-precision values. The [`StoredStateSeriesReader`](crate::storage::stored_state_series_reader::StoredStateSeriesReader)
//! remains responsible for finding the field by key, selecting this decoder,
//! and inserting the returned vector into the matching state slot.
//!
//! The expected JSON representation is an array of JSON numbers accepted by
//! Serde JSON for `f64`, for example `[1.0,-2.5,3.25]`.
//! Deserialization allocates the final vector directly and does not first build
//! a [`serde_json::Value`] tree. An empty array is valid. JSON `null`, scalar
//! values, nested arrays, and non-numeric elements are rejected by Serde.
//!
//! This decoder performs no key lookup, record parsing, state mutation,
//! filesystem access, or domain-specific validation of vector length and
//! values. Applications needing constraints such as a fixed dimension or a
//! finite-only vector should register a custom decoder for that key.
use JsonPayloadDecoder;
/// Stateless default decoder for payloads stored as `Vec<f64>`.
///
/// The unit struct is zero-sized and may be copied freely while configuring
/// decoder registries. Each registry entry still binds it to exactly one key
/// and the concrete `Vec<f64>` output type.
;