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
//! Call Interceptor
//!
//! Provides a trait for intercepting import (host function) and export (WASM function)
//! calls at the Pack runtime level. This enables automatic recording and replay of
//! all calls without handlers needing manual recording code.
//!
//! # Recording
//!
//! A recording interceptor returns `None` from `before_import`/`before_export`
//! (allowing normal execution) and records the input/output in `after_import`/`after_export`.
//!
//! # Replay
//!
//! A replay interceptor returns `Some(recorded_output)` from `before_import`/`before_export`,
//! short-circuiting the actual call and returning the previously recorded value.
use crateValue;
/// Trait for intercepting calls at the Pack runtime level.
///
/// Implementations can record calls (for audit/replay) or short-circuit
/// them with previously recorded values (for replay).
///
/// All methods are synchronous since recording (push to list) and replay
/// (read from list) are simple lookups that don't need async.