Skip to main content

StoredStateSeriesReader

Struct StoredStateSeriesReader 

Source
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

Source

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.

Source

pub fn recording_directory(&self) -> &Path

Returns the recording directory exactly as supplied at construction.

Source

pub fn stream_names(&self) -> impl ExactSizeIterator<Item = &str>

Iterates declared stream names in deterministic metadata order.

Source

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.

Source

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.

Trait Implementations§

Source§

impl Debug for StoredStateSeriesReader

Source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Formats bounded configuration without decoder internals or payloads.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.