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

Method set_generator

crates/vm/src/frame.rs:815–819  ·  view source on GitHub ↗

Store a borrowed back-reference to the owning generator/coroutine. The caller must ensure the generator outlives the frame.

(&self, generator: &PyObject)

Source from the content-addressed store, hash-verified

813 /// Store a borrowed back-reference to the owning generator/coroutine.
814 /// The caller must ensure the generator outlives the frame.
815 pub fn set_generator(&self, generator: &PyObject) {
816 self.generator.store(generator);
817 self.owner
818 .store(FrameOwner::Generator as i8, atomic::Ordering::Release);
819 }
820
821 /// Clear the generator back-reference. Called when the generator is finalized.
822 pub fn clear_generator(&self) {

Callers 1

invoke_with_localsMethod · 0.80

Calls 1

storeMethod · 0.45

Tested by

no test coverage detected