Skip to main content

Module enable

Module enable 

Source
Expand description

enable and disable: switch a ported unit in and out of the app with one command.

enable puts one marked block in each original source file of the unit (TS/JS or Python). The block loads the built Rust module and rebinds the ported functions, so every caller gets Rust without an import changing. disable removes exactly the lines enable added. At run time RUST_ANYTHING_MODE=old or the unit’s RUST_ANYTHING_UNIT_<NAME>=original keeps the original, and a module that fails to load falls back to it (RUST_ANYTHING_MODE=new makes that an error instead).

Structs§

Switched

Functions§

disable
enable
is_enabled
Whether enable left its block in any of the unit’s files.
is_supported
original_only
Sets the unit’s kill switch on a command that runs the original, so a recording, diff or bench of an enabled unit measures the original, not the port.