Skip to main content

wasmtime/runtime/
rr.rs

1//! Core WebAssembly record/replay for a whole store.
2//!
3//! Recording begins with an empty store, created by
4//! [`Store::new_recording`](crate::Store::new_recording). Objects receive
5//! numeric identities automatically; all construction is part of the trace.
6//! Traces identify core modules only by the checksums of their bytecode, so
7//! that they stay small.
8//!
9//! Core function boundaries support numbers, vectors, and abstract function
10//! references. Modules that use GC or exceptions are unsupported.
11//! Shared memory, host table/global mutation, call hooks,
12//! custom signal handlers, Wasm stack switching, epoch deadline callbacks, and
13//! guest debugging are unsupported. Fuel and epoch interruption may yield to
14//! the async executor, which the guest cannot observe, but a recording in
15//! which they stop the guest (by trapping, or by the call being cancelled
16//! while it yields) cannot be replayed. Host writes through the
17//! memory APIs, including slices from
18//! [`Memory::data_mut`](crate::Memory::data_mut), are recorded; writes through
19//! raw pointers such as [`Memory::data_ptr`](crate::Memory::data_ptr) are not.
20//!
21//! Traces describe execution at the level of WebAssembly semantics, and their
22//! format is versioned independently of Wasmtime, so that a trace does not have
23//! to be replayed by the version of Wasmtime that recorded it. They contain
24//! host-supplied data and can be large; applications should impose their own
25//! storage limits.
26
27// The rest of the runtime uses record/replay through the crate-private API that
28// both of these modules provide, which does nothing when the feature is
29// disabled.
30
31#[cfg(feature = "rr")]
32mod enabled;
33#[cfg(feature = "rr")]
34pub use enabled::*;
35
36#[cfg(not(feature = "rr"))]
37mod disabled;
38#[cfg(not(feature = "rr"))]
39pub(crate) use disabled::*;