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

Method push_held_rc

crates/wasm/src/vm_class.rs:185–194  ·  view source on GitHub ↗
(
        &self,
        obj: PyObjectRef,
    )

Source from the content-addressed store, hash-verified

183 }
184
185 pub(crate) fn push_held_rc(
186 &self,
187 obj: PyObjectRef,
188 ) -> Result<PyResult<PyRef<PyWeak>>, JsValue> {
189 self.with_vm(|vm, stored_vm| {
190 let weak = obj.downgrade(None, vm)?;
191 stored_vm.held_objects.borrow_mut().push(obj);
192 Ok(weak)
193 })
194 }
195
196 pub fn assert_valid(&self) -> Result<(), JsValue> {
197 if self.valid() {

Callers 2

newMethod · 0.80
py_to_jsFunction · 0.80

Calls 4

with_vmMethod · 0.80
borrow_mutMethod · 0.80
downgradeMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected