Skip to main content

build_linker

Function build_linker 

Source
pub fn build_linker(
    engine: &Engine,
    module: &Module,
) -> Result<Linker<SandboxState>>
Expand description

Construct the bespoke Linker exposing ONLY env::host_random.

Every other import the guest declares is wired to a trap via define_unknown_imports_as_traps — so if guest code ever actually reached for them it would trap rather than silently linking to nothing. This is what keeps the capability surface to exactly one function. (With rustpython-vm 0.5 the guest declares EXACTLY env::host_random and nothing else — but the trap-everything fence stays as a deny-by-default belt-and-suspenders for any future guest.)