Skip to main content

eval_source

Function eval_source 

Source
pub fn eval_source(
    files: HashMap<String, String>,
    entry: &str,
    opts: &EvalOptions,
) -> Result<Evaluated, Vec<Report>>
Expand description

Evaluate a manifest that exists only in memory: files maps a name to its text, entry is the one to start from. Imports resolve inside that map, so a multi-file example works without touching a disk — this is what a browser playground or a test harness needs.

read_file() reads the same map, and is still capability-gated exactly as on disk: with an empty allow_read it is denied. The paths in allow_read are not consulted otherwise, since there is no filesystem to confine.