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: &Path,
decoders: JsonPayloadDecoderRegistry,
) -> Result<Self, PersistenceError>
pub fn open_completed_recording( root: &Path, decoders: JsonPayloadDecoderRegistry, ) -> Result<Self, PersistenceError>
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 PersistenceError::Io when metadata.json cannot be read,
PersistenceError::Json when it is not syntactically valid JSON, semantic
metadata errors from internal RecordingMetadata::validate, or
PersistenceError::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 format_version(&self) -> u32
pub fn format_version(&self) -> u32
Returns the validated persistence format version.
Sourcepub fn user_metadata(&self) -> &Map<String, Value>
pub fn user_metadata(&self) -> &Map<String, Value>
Borrows immutable metadata supplied when recording began.
Sourcepub fn terminal_metadata(&self) -> &Map<String, Value>
pub fn terminal_metadata(&self) -> &Map<String, Value>
Borrows values committed only at successful completion.
Sourcepub fn recording_timing(&self) -> &RecordingTiming
pub fn recording_timing(&self) -> &RecordingTiming
Borrows automatic operational timing for the completed recording.
Sourcepub fn stream_record_count(&self, stream: &str) -> Result<u64, PersistenceError>
pub fn stream_record_count(&self, stream: &str) -> Result<u64, PersistenceError>
Returns the metadata-declared record count for one completed stream.
Sourcepub fn stream_encoded_bytes(
&self,
stream: &str,
) -> Result<u64, PersistenceError>
pub fn stream_encoded_bytes( &self, stream: &str, ) -> Result<u64, PersistenceError>
Returns the exact metadata-declared encoded bytes for one stream.
Sourcepub fn read_stream_as_state_series(
&self,
stream: &str,
) -> Result<StateSeries, PersistenceError>
pub fn read_stream_as_state_series( &self, stream: &str, ) -> Result<StateSeries, PersistenceError>
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)>, PersistenceError>
pub fn read_all_streams_as_state_series( &self, ) -> Result<Vec<(String, StateSeries)>, PersistenceError>
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.
Sourcepub fn read_latest_state_from_stream(
&self,
stream: &str,
) -> Result<SystemState, PersistenceError>
pub fn read_latest_state_from_stream( &self, stream: &str, ) -> Result<SystemState, PersistenceError>
Reconstructs only the latest state in one completed stream.
Earlier chunks are not opened. The newest chunk’s length, checksum, framing, record count, positional widths, iteration order, and declared first/final iterations are verified before its final record is decoded into the stream’s partial schema. This is suitable for final-value analysis; the returned partial state is not an append/resume handle.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for StoredStateSeriesReader
impl !UnwindSafe for StoredStateSeriesReader
impl Freeze for StoredStateSeriesReader
impl Send for StoredStateSeriesReader
impl Sync for StoredStateSeriesReader
impl Unpin for StoredStateSeriesReader
impl UnsafeUnpin for StoredStateSeriesReader
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more