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

Method empty

crates/stdlib/src/contextvars.rs:72–80  ·  view source on GitHub ↗
(vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

70
71 impl PyContext {
72 fn empty(vm: &VirtualMachine) -> Self {
73 Self {
74 inner: ContextInner {
75 idx: Cell::new(usize::MAX),
76 vars: HamtObject::default().into_ref(&vm.ctx),
77 entered: Cell::new(false),
78 },
79 }
80 }
81
82 fn borrow_vars(&self) -> impl core::ops::Deref<Target = Hamt> + '_ {
83 self.inner.vars.hamt.borrow()

Callers

nothing calls this directly

Calls 2

newFunction · 0.85
into_refMethod · 0.45

Tested by

no test coverage detected