pub struct FrameLocals { /* private fields */ }Expand description
Lazy locals dict for frames. For NEWLOCALS frames, the dict is only allocated on first access (most function frames never need it).
Implementations§
Source§impl FrameLocals
impl FrameLocals
Sourcepub fn get_or_create(&self, vm: &VirtualMachine) -> &ArgMapping
pub fn get_or_create(&self, vm: &VirtualMachine) -> &ArgMapping
Get the locals mapping, creating it lazily if needed.
Sourcepub fn get(&self) -> Option<&ArgMapping>
pub fn get(&self) -> Option<&ArgMapping>
Get the locals mapping if already created.
pub fn mapping(&self, vm: &VirtualMachine) -> PyMapping<'_>
pub fn clone_mapping(&self, vm: &VirtualMachine) -> ArgMapping
pub fn into_object(&self, vm: &VirtualMachine) -> PyObjectRef
pub fn as_object(&self, vm: &VirtualMachine) -> &PyObject
Trait Implementations§
Source§impl Clone for FrameLocals
impl Clone for FrameLocals
Source§impl Debug for FrameLocals
impl Debug for FrameLocals
Source§impl Traverse for FrameLocals
impl Traverse for FrameLocals
Source§fn traverse(&self, tracer_fn: &mut TraverseFn<'_>)
fn traverse(&self, tracer_fn: &mut TraverseFn<'_>)
impl
traverse() with caution! Following those guideline so traverse doesn’t cause memory error!: Read moreSource§fn clear(&mut self, _out: &mut Vec<PyObjectRef>)
fn clear(&mut self, _out: &mut Vec<PyObjectRef>)
Extract all owned child PyObjectRefs for circular reference resolution (tp_clear).
Called just before object deallocation to break circular references.
Default implementation does nothing.
Auto Trait Implementations§
impl !Freeze for FrameLocals
impl !RefUnwindSafe for FrameLocals
impl !Send for FrameLocals
impl !Sync for FrameLocals
impl Unpin for FrameLocals
impl UnsafeUnpin for FrameLocals
impl !UnwindSafe for FrameLocals
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more