Skip to main content

script_exports

Function script_exports 

Source
pub fn script_exports(
    dir: &Path,
    script: &CompiledScript,
    addons: &[Addon],
) -> Option<Result<Vec<String>, String>>
Expand description

The names a compiled program can be called by.

None for a program with no ahead-of-time form, and for one whose language has no host in reach that can read an image back: neither knows what the program exports, and neither can say anything is missing from it.

A build tool asks this to tell a function the app calls by name from one it will only appear to call: candela exports a function only when every parameter it takes is annotated, and a shipped runtime carries no compiler to fall back on.

dir is the app the program belongs to. addons are the browser add-ons the app was compiled against; their functions are declared in the program, so reading it back binds them too.