Skip to main content

Module hooks

Module hooks 

Source
Expand description

Discovery hook: the one-way coupling surface to an exploration backend.

The accounting layer (crate::slots, crate::buckets) calls these hooks at the exact points where something “new” happens — a first Sometimes/Reachable pass, a numeric watermark improvement, a frontier advance, or an each-bucket hit. With no hook installed (the default — wasm, macOS, plain native runs) the calls are no-ops and accounting is pure. An exploration backend (moonpool-explorer) installs hooks that mark coverage and dispatch forks.

This mirrors moonpool-explorer’s own set_rng_hooks pattern, inverted: there the sim hands the explorer RNG hooks; here the explorer hands this crate its discovery hooks. The function pointers are stored in a thread-local Cell set before forking, so forked children inherit them.

Structs§

DiscoveryHooks
Discovery callbacks installed by an exploration backend.

Functions§

clear_discovery_hooks
Remove any installed hooks, reverting to pure accounting.
set_discovery_hooks
Install the discovery hooks. Must be called before forking; children inherit the hooks via thread-local storage.