pub struct InterpreterFrame {
pub locals: FrameLocals,
pub lasti: PyAtomic<u32>,
pub generator: PyAtomicBorrow,
/* private fields */
}Expand description
Lightweight execution frame. Not a PyObject.
Analogous to CPython’s _PyInterpreterFrame.
The four identity fields (code, globals, builtins, func_obj)
are borrowed raw pointers. Construction is unsafe and is what
establishes that they stay valid for the frame’s life (or until
init_iframe_ptrs overwrites them). A live InterpreterFrame may
then be executed through safe APIs such as run_iframe.
Fields§
§locals: FrameLocals§lasti: PyAtomic<u32>index of last instruction ran
generator: PyAtomicBorrowBack-reference to owning generator/coroutine/async generator. Borrowed reference (not ref-counted) to avoid Generator↔FrameObject cycle. Cleared by the generator’s Drop impl.
Implementations§
Auto Trait Implementations§
impl !Freeze for InterpreterFrame
impl !RefUnwindSafe for InterpreterFrame
impl !Send for InterpreterFrame
impl !Sync for InterpreterFrame
impl !UnwindSafe for InterpreterFrame
impl Unpin for InterpreterFrame
impl UnsafeUnpin for InterpreterFrame
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<T> Helper for T
Source§impl<T, U> ImaginaryInto<U> for Twhere
U: ImaginaryFrom<T>,
impl<T, U> ImaginaryInto<U> for Twhere
U: ImaginaryFrom<T>,
fn imaginary_into(self) -> U
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