#[non_exhaustive]pub enum StateError {
TemplateRead {
path: PathBuf,
source: Error,
},
TemplateParse {
path: PathBuf,
source: Error,
},
EmptyFieldName {
index: usize,
},
DuplicateField {
field: String,
},
UnknownField {
field: String,
},
RepeatedPayloadBorrow {
field: String,
},
MissingPayload {
field: String,
},
TypeMismatch {
field: String,
expected: &'static str,
actual: &'static str,
},
IterationOverflow {
iteration: u64,
},
MissingPhysicalTime {
iteration: u64,
},
InvalidPhysicalAdvance {
current: f64,
delta: f64,
},
}Expand description
A failure encountered while defining, accessing, or advancing a state.
StateError is non-exhaustive because later workflow features may add
validation failures without forcing downstream crates to update exhaustive
matches. Callers should match variants of interest and retain a fallback
arm.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
TemplateRead
A JSON state template could not be read from the filesystem.
TemplateParse
A state template was readable but did not contain valid JSON.
Fields
EmptyFieldName
A field definition used an empty or whitespace-only name.
DuplicateField
Two field definitions used the same name.
UnknownField
An operation addressed a key that is absent from the template layout.
RepeatedPayloadBorrow
One coordinated borrow requested the same resolved field more than once.
Mutable aliases to one payload would violate Rust’s exclusivity rules.
Immutable coordinated borrows reject the same input as well so
SystemState::borrow_payloads and SystemState::borrow_payloads_mut retain identical,
predictable request validation.
MissingPayload
An operation required a payload from a declared but currently empty field.
TypeMismatch
A typed operation requested a different Rust type from the retained field contract.
Fields
IterationOverflow
Incrementing the authoritative iteration would overflow u64.
SystemState::advance_simulation_time will detect this condition before mutating the
state, so the original time point remains unchanged.
MissingPhysicalTime
A physical-time delta was requested for a state without a physical coordinate.
Absence is not interpreted as zero: callers must establish a known origin explicitly before advancing physical time.
InvalidPhysicalAdvance
A physical-time delta or its sum with the current coordinate is not finite.
Both operands are retained for diagnosis. This variant covers a non-finite input delta and finite operands whose addition overflows to infinity. The state remains unchanged.
Trait Implementations§
Source§impl Debug for StateError
impl Debug for StateError
Source§impl Display for StateError
impl Display for StateError
Source§impl Error for StateError
impl Error for StateError
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 StateError
impl !UnwindSafe for StateError
impl Freeze for StateError
impl Send for StateError
impl Sync for StateError
impl Unpin for StateError
impl UnsafeUnpin for StateError
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