pub struct StoredStateSeriesReader { /* private fields */ }Expand description
Reader that reconstructs complete in-memory series from one completed recording.
Construction consumes the decoder registry so decoder configuration and metadata remain one coherent read authority. The type is intentionally non-Clone because registered decoders may not have meaningful clone semantics.
Implementations§
Source§impl StoredStateSeriesReader
impl StoredStateSeriesReader
Sourcepub fn open_completed_recording(
root: impl AsRef<Path>,
decoders: JsonPayloadDecoderRegistry,
) -> Result<Self, StorageError>
pub fn open_completed_recording( root: impl AsRef<Path>, decoders: JsonPayloadDecoderRegistry, ) -> Result<Self, StorageError>
Opens one recording directory and validates its authoritative metadata.
The metadata snapshot must declare successful completion. Reading an active or failed recording is deliberately rejected because its chunk inventory is not a complete analysis result.
Decoder coverage is checked per selected stream by
StoredStateSeriesReader::read_stream_as_state_series, allowing one registry to serve only the streams
an analysis intends to load.
§Errors
Returns StorageError::Io when metadata.json cannot be read,
StorageError::Json when it is not syntactically valid JSON, semantic
metadata errors from internal RecordingMetadata::validate, or
StorageError::RecordingNotComplete unless status is complete.
Sourcepub fn recording_directory(&self) -> &Path
pub fn recording_directory(&self) -> &Path
Returns the recording directory exactly as supplied at construction.
Sourcepub fn stream_names(&self) -> impl ExactSizeIterator<Item = &str>
pub fn stream_names(&self) -> impl ExactSizeIterator<Item = &str>
Iterates declared stream names in deterministic metadata order.
Sourcepub fn read_stream_as_state_series(
&self,
stream: &str,
) -> Result<StateSeries, StorageError>
pub fn read_stream_as_state_series( &self, stream: &str, ) -> Result<StateSeries, StorageError>
Reconstructs one named logical stream as a complete StateSeries.
The method validates decoder coverage before opening chunk files. It then checks every chunk’s filesystem length, processes its complete JSONL records in order, verifies descriptor record/index facts and SHA-256, and appends only fully decoded states to the private series.
§Errors
Returns precise stream-selection, decoder, filesystem, integrity, record, payload-conversion, or series-invariant errors. No partially reconstructed series is returned on failure.
Sourcepub fn read_all_streams_as_state_series(
&self,
) -> Result<Vec<(String, StateSeries)>, StorageError>
pub fn read_all_streams_as_state_series( &self, ) -> Result<Vec<(String, StateSeries)>, StorageError>
Reconstructs every declared stream in metadata order.
Distinct stream schemas and sampling intervals remain distinct series. If any stream fails, already reconstructed series are dropped and no partial vector is returned.