#[non_exhaustive]pub enum PersistenceError {
Show 30 variants
Observation {
source: ObservationError,
},
RecordingDirectoryExists {
path: PathBuf,
},
InvalidConfiguration {
setting: &'static str,
reason: String,
},
DuplicateStateStream {
stream: String,
},
UnknownStateStream {
stream: String,
},
StateWriterClosed,
RecordingFinished,
RecordingDirectoryInUse {
path: PathBuf,
},
NoRecordedState {
stream: String,
},
OperationalTimestamp {
operation: &'static str,
source: Format,
},
OperationalDurationOverflow,
UnsupportedVersion {
path: PathBuf,
found: u32,
supported: u32,
},
InvalidMetadata {
path: PathBuf,
reason: String,
},
RecordingNotComplete {
path: PathBuf,
},
MissingChunk {
path: PathBuf,
},
ChunkSizeMismatch {
path: PathBuf,
expected: u64,
actual: u64,
},
ChecksumMismatch {
path: PathBuf,
expected: String,
actual: String,
},
InvalidRecord {
path: PathBuf,
line: u64,
reason: String,
},
DuplicateDecoder {
field: String,
},
MissingDecoder {
field: String,
},
DecodeField {
stream: String,
iteration: u64,
field: String,
source: Box<dyn Error + Send + Sync + 'static>,
},
StateSeriesInvariant {
stream: String,
iteration: u64,
source: StateSeriesError,
},
Io {
operation: &'static str,
path: PathBuf,
source: Error,
},
Json {
operation: &'static str,
path: PathBuf,
source: Error,
},
ByteCountOverflow {
stream: String,
},
RecordTooLarge {
stream: String,
bytes: u64,
limit: u64,
},
OutOfOrderIteration {
stream: String,
iteration: u64,
previous: u64,
},
WriterQueueDisconnected,
StateWriterTerminated {
source: Arc<PersistenceError>,
},
StateWriterPanicked,
}Expand description
A failure encountered while encoding, writing, reading, or decoding a run.
Variants are grouped by the boundary that detects them: configuration and lifecycle, persisted-format validation, field processing, filesystem and JSON mechanics, and asynchronous writer coordination.
The enum is non-exhaustive so future integrity checks or durability modes can add precise variants without forcing downstream crates to exhaustively match every persistence failure.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Observation
The scientific observation layer rejected a plan or live observation.
Fields
source: ObservationErrorOriginal observation-layer failure.
RecordingDirectoryExists
A new recording refused to replace an existing path.
Persistence never silently overwrites a previous recording. This crate exposes no continuation or resume path for an existing directory.
InvalidConfiguration
One persistence setting violates a constructor invariant.
Settings represented by NonZero* types are rejected before this
point. This variant covers relationships between values, unsafe relative
paths, unsupported names, and similar semantic configuration failures.
Fields
DuplicateStateStream
Two logical output streams were configured with the same name.
UnknownStateStream
A caller selected a stream absent from the recording declaration.
StateWriterClosed
The recording-wide writer has stopped accepting new work.
RecordingFinished
A caller repeated a recording operation after successful termination.
RecordingDirectoryInUse
Another writer currently owns the recording directory.
NoRecordedState
A completed stream contains no record to reconstruct.
OperationalTimestamp
The host UTC clock could not be represented in the canonical metadata timestamp format.
Fields
OperationalDurationOverflow
A monotonic writer session exceeded the exact persisted duration range.
UnsupportedVersion
metadata.json declares a format version this crate cannot read.
Fields
InvalidMetadata
Syntactically valid metadata violates a semantic persistence invariant.
Fields
RecordingNotComplete
A reader requiring a completed recording encountered terminally unsuitable metadata.
MissingChunk
A committed chunk named by metadata is absent from the filesystem.
ChunkSizeMismatch
A committed chunk’s actual length differs from its metadata descriptor.
Fields
ChecksumMismatch
A committed chunk’s checksum differs from its metadata descriptor.
Fields
InvalidRecord
One syntactically readable JSONL record violates record invariants.
Fields
DuplicateDecoder
A decoder registration attempted to reuse one field key.
MissingDecoder
No concrete payload decoder was declared for a persisted field key.
DecodeField
A user-supplied field decoder failed to reconstruct its concrete value.
Fields
StateSeriesInvariant
A reconstructed state violated its destination series invariant.
The rejected state is intentionally not retained in this error: it was created from persisted input and is dropped on failed reconstruction, preventing an error value from pinning arbitrarily large payloads.
Fields
source: StateSeriesErrorOriginal in-memory collection invariant failure.
Io
A filesystem operation failed.
Fields
Json
JSON framing, metadata serialization, or raw record parsing failed.
Fields
ByteCountOverflow
Exact byte accounting overflowed its u64 persisted representation.
RecordTooLarge
One indivisible record exceeds the stream’s strict queue-byte budget.
Returning immediately is essential: waiting for capacity can never make a record larger than the complete budget admissible.
Fields
OutOfOrderIteration
A stream submission did not advance its iteration.
Fields
WriterQueueDisconnected
The bounded recording queue disconnected before shutdown completed.
StateWriterTerminated
The recording worker terminated with an authoritative persistence failure.
The shared source lets multiple blocked submitters observe the same terminal failure without cloning an IO or JSON error.
Fields
source: Arc<PersistenceError>Shared authoritative worker failure.
StateWriterPanicked
Joining a writer thread revealed an unexpected panic.
Trait Implementations§
Source§impl Debug for PersistenceError
impl Debug for PersistenceError
Source§impl Display for PersistenceError
impl Display for PersistenceError
Source§impl Error for PersistenceError
impl Error for PersistenceError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Auto Trait Implementations§
impl !RefUnwindSafe for PersistenceError
impl !UnwindSafe for PersistenceError
impl Freeze for PersistenceError
impl Send for PersistenceError
impl Sync for PersistenceError
impl Unpin for PersistenceError
impl UnsafeUnpin for PersistenceError
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 moreSource§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read more