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

Function pyresult_to_js_result

crates/wasm/src/convert.rs:175–179  ·  view source on GitHub ↗
(vm: &VirtualMachine, result: PyResult)

Source from the content-addressed store, hash-verified

173}
174
175pub fn pyresult_to_js_result(vm: &VirtualMachine, result: PyResult) -> Result<JsValue, JsValue> {
176 result
177 .map(|value| py_to_js(vm, value))
178 .map_err(|err| py_err_to_js_err(vm, &err))
179}
180
181pub fn js_to_py(vm: &VirtualMachine, js_val: JsValue) -> PyObjectRef {
182 if js_val.is_object() {

Callers 4

newMethod · 0.85
thenMethod · 0.85
runMethod · 0.85
py_to_jsFunction · 0.85

Calls 3

py_to_jsFunction · 0.85
py_err_to_js_errFunction · 0.85
mapMethod · 0.45

Tested by

no test coverage detected