1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
//! Structured error types for parsing, input validation, running, and tracing.
//!
//! The interpreter reports errors as structured data first. Human-readable text
//! is kept in formatting implementations, so parser and runtime code construct
//! typed reasons instead of scattering presentation strings across the core.
//! Each public error type belongs to one phase boundary; callers should not
//! collapse them into one catch-all type unless their own boundary no longer
//! needs to distinguish user source, user input, run admission, runtime
//! execution, snapshot materialization, and callback failures.
//!
//! The main domains are:
//!
//! - [`ParseError`] for source syntax, parser allocation, parser
//! representation, and parser-invariant failures.
//! - [`RuntimeInputError`] for raw input bytes rejected before execution and
//! runtime-input witness contradictions.
//! - [`RunAdmissionError`] for validated input rejected as an initial runtime state.
//! - [`RunError`] for execution-time allocation, internal-invariant,
//! state-size, and budget failures.
//! - [`AllocationError`] for explicit allocation boundaries such as view
//! materialization, canonical source construction, final output conversion,
//! and trace snapshots. [`AllocationContext`] names the failing boundary, and
//! [`RequestedCapacity`] carries the requested vector capacity for reservation
//! failures.
//! - [`TraceSnapshotError`] and traced run errors for trace materialization or
//! user callback failures.
//!
//! ```
//! use rsaeb::error::RuntimeInputError;
//! use rsaeb::input::{RuntimeInput, RuntimeInputSource};
//! use rsaeb::limits::{RuntimeInputByteLimit, RuntimeInputLimits};
//!
//! fn validate(bytes: &[u8]) -> Result<RuntimeInput, RuntimeInputError> {
//! RuntimeInput::validate(
//! RuntimeInputSource::from_bytes(bytes),
//! RuntimeInputLimits::new(RuntimeInputByteLimit::new(8)),
//! )
//! }
//!
//! # fn main() -> Result<(), Box<dyn std::error::Error>> {
//! let Err(error) = validate(&[b'a', 0xff]) else {
//! return Err("expected invalid input".into());
//! };
//!
//! if !matches!(
//! error,
//! RuntimeInputError::NonAscii { column, byte }
//! if column.get() == 2 && byte.get() == 0xff
//! ) {
//! return Err("unexpected input error".into());
//! }
//! # Ok(())
//! # }
//! ```
/// Display implementations for public error domains.
/// Parse error model.
/// Runtime and admission error model.
/// Trace error model.
pub use crate;
pub use crate;
pub use ;
pub use ;
pub use ;