Skip to main content

StateSeriesError

Enum StateSeriesError 

Source
#[non_exhaustive]
pub enum StateSeriesError { SchemaMismatch { iteration: u64, }, NonIncreasingIteration { previous: u64, next: u64, }, PositionOutOfBounds { position: usize, len: usize, }, PayloadAccess { position: usize, source: StateError, }, }
Expand description

A failure produced while maintaining or mutating an in-memory state series.

The enum is intentionally small and independent of persistence. Every variant is either a collection invariant violation or contextualized typed access into one already-stored state.

StateSeriesError is non-exhaustive so additional analysis invariants can be introduced without forcing downstream crates to use exhaustive matches. Callers should therefore retain a fallback match arm.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

SchemaMismatch

The rejected state does not share the series’ canonical layout.

Structural equality is insufficient: accepted states must derive from the same SystemStateSchema allocation. The rejected state’s iteration is retained for diagnostics without inspecting or formatting any scientific payload.

Fields

§iteration: u64

Iteration carried by the rejected state.

§

NonIncreasingIteration

The rejected state would violate strictly increasing simulation order.

Iteration gaps are permitted, but an equal or decreasing value would make ordered iteration ambiguous. Physical time is not used for ordering because it is optional and may follow an application-specific scale.

Fields

§previous: u64

Iteration of the series’ current final state.

§next: u64

Iteration carried by the rejected state.

§

PositionOutOfBounds

A mutable analysis request selected no stored state.

position is a zero-based position in the series rather than a simulation iteration. Both the attempted position and current length are recorded so callers can diagnose stale analysis selections.

Fields

§position: usize

Zero-based series position requested by the caller.

§len: usize

Number of states stored when the request was evaluated.

§

PayloadAccess

Typed mutable access failed inside the selected state.

The source distinguishes an undeclared key, an empty field, and a concrete payload type mismatch. Wrapping it here adds the series position while preserving std::error::Error::source traversal.

Fields

§position: usize

Zero-based position of the state containing the requested field.

§source: StateError

Original typed access failure reported by SystemState::payload_mut.

Trait Implementations§

Source§

impl Debug for StateSeriesError

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Display for StateSeriesError

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Error for StateSeriesError

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToCompactString for T
where T: Display,

Source§

impl<T> ToLine for T
where T: Display,

Source§

fn to_line(&self) -> Line<'_>

Converts the value to a Line.
Source§

impl<T> ToSpan for T
where T: Display,

Source§

fn to_span(&self) -> Span<'_>

Converts the value to a Span.
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T> ToText for T
where T: Display,

Source§

fn to_text(&self) -> Text<'_>

Converts the value to a Text.
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.