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

Method send

crates/wasm/src/js_module.rs:566–577  ·  view source on GitHub ↗
(&self, val: Option<PyObjectRef>, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

564 impl AwaitPromise {
565 #[pymethod]
566 fn send(&self, val: Option<PyObjectRef>, vm: &VirtualMachine) -> PyResult<PyIterReturn> {
567 match self.obj.take() {
568 Some(prom) => {
569 if val.is_some() {
570 Err(vm.new_type_error("can't send non-None value to an AwaitPromise"))
571 } else {
572 Ok(PyIterReturn::Return(prom))
573 }
574 }
575 None => Ok(PyIterReturn::StopIteration(val)),
576 }
577 }
578
579 #[pymethod]
580 fn throw(

Callers 1

nextMethod · 0.45

Calls 2

ErrClass · 0.50
takeMethod · 0.45

Tested by

no test coverage detected