#[non_exhaustive]pub enum StateError {
TemplateRead {
path: PathBuf,
source: Error,
},
TemplateParse {
path: PathBuf,
source: Error,
},
EmptyFieldName {
index: usize,
},
DuplicateField {
field: String,
},
EmptyTypeTag {
field: String,
},
UnknownField {
field: String,
},
MissingValue {
field: String,
},
TypeMismatch {
field: String,
expected: &'static str,
actual: &'static str,
},
FieldCountMismatch {
expected: usize,
actual: usize,
},
}Expand description
A failure encountered while loading a state template or accessing 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.
EmptyTypeTag
A field definition used an empty or whitespace-only codec type tag.
UnknownField
An operation addressed a key that is absent from the template layout.
MissingValue
An operation required a payload from a declared but currently empty field.
TypeMismatch
A typed operation requested a different Rust type from the stored one.
Fields
FieldCountMismatch
A reconstructed state supplied a slot count incompatible with its template layout.
Normal state creation allocates the correct number of slots. This variant primarily protects deserialization and future storage backends from constructing structurally invalid states.
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()