MCPcopy Index your code
hub / github.com/RustPython/RustPython / main

Function main

examples/package_embed.rs:18–30  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

16}
17
18fn main() -> ExitCode {
19 // Add standard library path
20 let mut settings = vm::Settings::default();
21 settings.path_list.push("Lib".to_owned());
22 let builder = vm::Interpreter::builder(settings);
23 let defs = rustpython_stdlib::stdlib_module_defs(&builder.ctx);
24 let interp = builder.add_native_modules(&defs).build();
25 let result = py_main(&interp);
26 let result = result.map(|result| {
27 println!("name: {result}");
28 });
29 vm::common::os::exit_code(interp.run(|_vm| result))
30}

Callers

nothing calls this directly

Calls 9

stdlib_module_defsFunction · 0.85
exit_codeFunction · 0.85
add_native_modulesMethod · 0.80
py_mainFunction · 0.70
pushMethod · 0.45
to_ownedMethod · 0.45
buildMethod · 0.45
mapMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected