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
//! 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.
//!
//! The main domains are:
//!
//! - [`ParseError`] for source syntax and parser allocation failures.
//! - [`RuntimeInputError`] for raw input bytes rejected before execution.
//! - [`RunError`] for execution-time allocation, 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::limits::RuntimeInputByteLimit;
//! use rsaeb::{RuntimeInput, RuntimeInputSource};
//!
//! fn validate(bytes: &[u8]) -> Result<RuntimeInput, RuntimeInputError> {
//! RuntimeInput::validate(
//! RuntimeInputSource::from_bytes(bytes),
//! 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());
//! };
//!
//! assert!(matches!(
//! error,
//! RuntimeInputError::NonAscii { column, byte }
//! if column.get() == 2 && byte.get() == 0xff
//! ));
//! # Ok(())
//! # }
//! ```
pub use crate;
pub use crate;
pub use ;
pub use ;
pub use ;