pub struct FrameObject { /* private fields */ }Implementations§
Source§impl FrameObject
impl FrameObject
Source§impl FrameObject
impl FrameObject
Sourcepub fn iframe(&self) -> &InterpreterFrame
pub fn iframe(&self) -> &InterpreterFrame
Shared access to the embedded interpreter frame. Safe to call on any reachable FrameObject: immutable fields and atomic/mutex fields are always safe to access.
Source§impl FrameObject
impl FrameObject
Sourcepub unsafe fn fastlocals(&self) -> &[Option<PyObjectRef>]
pub unsafe fn fastlocals(&self) -> &[Option<PyObjectRef>]
Access fastlocals immutably.
§Safety
Caller must ensure no concurrent mutable access (frame not executing, or called from the same thread during trace callback).
Sourcepub unsafe fn fastlocals_mut(&self) -> &mut [Option<PyObjectRef>]
pub unsafe fn fastlocals_mut(&self) -> &mut [Option<PyObjectRef>]
Sourcepub fn set_generator(&self, generator: &PyObject)
pub fn set_generator(&self, generator: &PyObject)
Store a borrowed back-reference to the owning generator/coroutine. The caller must ensure the generator outlives the frame.
Sourcepub fn clear_generator(&self)
pub fn clear_generator(&self)
Clear the generator back-reference. Called when the generator is finalized.
pub fn current_location(&self) -> SourceLocation
Sourcepub fn previous_iframe(&self) -> *const InterpreterFrame
pub fn previous_iframe(&self) -> *const InterpreterFrame
Get the previous InterpreterFrame in the chain. Returns null if the frame has been cleared (GC deallocation).
Sourcepub fn previous_frame(&self) -> *const Self
pub fn previous_frame(&self) -> *const Self
Get the previous FrameObject in the chain, if any. Walks through the chain to find the next materialized frame.
pub fn lasti(&self) -> u32
pub fn set_lasti(&self, val: u32)
pub fn locals(&self, vm: &VirtualMachine) -> PyResult<ArgMapping>
Sourcepub fn locals_snapshot_cache(&self, vm: &VirtualMachine) -> PyDictRef
pub fn locals_snapshot_cache(&self, vm: &VirtualMachine) -> PyDictRef
Return the lazily allocated dict used by APIs that must keep a frame-owned locals snapshot. Ordinary VM execution never accesses it.
Trait Implementations§
Source§impl Debug for FrameObject
impl Debug for FrameObject
Source§impl MaybeTraverse for FrameObject
impl MaybeTraverse for FrameObject
Source§const HAS_TRAVERSE: bool = true
const HAS_TRAVERSE: bool = true
Source§const HAS_CLEAR: bool = true
const HAS_CLEAR: bool = true
fn try_traverse(&self, tracer_fn: &mut TraverseFn<'_>)
fn try_clear(&mut self, out: &mut Vec<PyObjectRef>)
Source§impl PyClassDef for FrameObject
impl PyClassDef for FrameObject
const NAME: &'static str = "frame"
const MODULE_NAME: Option<&'static str> = None
const TP_NAME: &'static str = "frame"
const DOC: ItemDoc = ::rustpython_vm::function::ItemDoc::NONE
Source§const ATTR_DOCS: &'static [(&'static str, u32, u32)]
const ATTR_DOCS: &'static [(&'static str, u32, u32)]
(u32::MAX, 0) is an explicit empty doc.const BASICSIZE: usize
const UNHASHABLE: bool = false
const MEMBERS: &'static [PyMemberSpec]
type Base = PyBaseObject
fn assert_member_layout()
const ITEMSIZE: usize = 0
Source§impl PyClassImpl for FrameObject
impl PyClassImpl for FrameObject
const TP_FLAGS: PyTypeFlags
Source§const INTERNAL_DOC: ItemDoc
const INTERNAL_DOC: ItemDoc
ItemDoc::NONE when the constructor has no signature.const METHOD_DEFS: &'static [PyMethodDef]
fn impl_extend_class(ctx: &'static Context, class: &'static Py<PyType>)
fn extend_slots(slots: &mut PyTypeSlots)
fn extend_class(ctx: &'static Context, class: &'static Py<PyType>)where
Self: Sized,
fn make_static_type() -> PyTypeRefwhere
Self: StaticType + Sized,
fn make_slots() -> PyTypeSlots
Source§impl PyPayload for FrameObject
impl PyPayload for FrameObject
Source§const MAX_FREELIST: usize = 200
const MAX_FREELIST: usize = 200
Source§const HAS_FREELIST: bool = true
const HAS_FREELIST: bool = true
Source§const NEW_REF_UNTRACKED: bool = true
const NEW_REF_UNTRACKED: bool = true
PyRef::new_ref skips auto-tracking this type in the GC even
when it would otherwise qualify (has traverse, dict, or heap type).
Such objects are created untracked and must be tracked explicitly if
and when they can become part of a reference cycle. Used by FrameObject,
which is created untracked and tracked lazily only on escape.fn class(ctx: &Context) -> &'static Py<PyType>
Source§unsafe fn freelist_push(obj: *mut PyObject) -> bool
unsafe fn freelist_push(obj: *mut PyObject) -> bool
Source§unsafe fn freelist_pop(_payload: &Self) -> Option<NonNull<PyObject>>
unsafe fn freelist_pop(_payload: &Self) -> Option<NonNull<PyObject>>
ref_count, gc_bits, and payload. Read moreconst PAYLOAD_TYPE_ID: TypeId = _
fn try_downcast_from(obj: &PyObject, vm: &VirtualMachine) -> PyResult<()>
fn into_pyobject(self, vm: &VirtualMachine) -> PyObjectRefwhere
Self: Debug,
fn _into_ref(self, cls: PyTypeRef, ctx: &Context) -> PyRef<Self>where
Self: Debug,
fn into_exact_ref(self, ctx: &Context) -> PyRefExact<Self>where
Self: Debug,
fn into_ref(self, ctx: &Context) -> PyRef<Self>where
Self: Debug,
fn into_ref_with_type(
self,
vm: &VirtualMachine,
cls: PyTypeRef,
) -> PyResult<PyRef<Self>>where
Self: Debug,
Source§fn into_ref_with_type_lazy_dict(
self,
vm: &VirtualMachine,
cls: PyTypeRef,
) -> PyResult<PyRef<Self>>where
Self: Debug,
fn into_ref_with_type_lazy_dict(
self,
vm: &VirtualMachine,
cls: PyTypeRef,
) -> PyResult<PyRef<Self>>where
Self: Debug,
into_ref_with_type, but leaves the instance __dict__ unallocated
until the first attribute write or __dict__ access. Only valid for types
whose attribute protocol materializes the dict lazily via get_or_insert.fn into_ref_with_type_and_dict(
self,
vm: &VirtualMachine,
cls: PyTypeRef,
eager_dict: bool,
) -> PyResult<PyRef<Self>>where
Self: Debug,
Source§impl Representable for FrameObject
impl Representable for FrameObject
fn repr_str(zelf: &Py<Self>, vm: &VirtualMachine) -> PyResult<String>
fn slot_repr(zelf: &PyObject, vm: &VirtualMachine) -> PyResult<PyRef<PyStr>>
fn repr(zelf: &Py<Self>, vm: &VirtualMachine) -> PyResult<PyRef<PyStr>>
fn repr_wtf8(zelf: &Py<Self>, vm: &VirtualMachine) -> PyResult<Wtf8Buf>
const __OWN_METHOD_DEFS: &'static [PyMethodDef] = _
fn __extend_py_class(ctx: &'static Context, class: &'static Py<PyType>)
fn __extend_slots(slots: &mut PyTypeSlots)
Source§impl StaticType for FrameObject
impl StaticType for FrameObject
fn static_cell() -> &'static StaticCell<PyTypeRef>
fn static_metaclass() -> &'static Py<PyType>
fn static_baseclass() -> &'static Py<PyType>
fn static_type() -> &'static Py<PyType>
fn init_manually(typ: PyTypeRef) -> &'static Py<PyType>
fn init_builtin_type() -> &'static Py<PyType>where
Self: PyClassImpl,
fn create_static_type() -> PyTypeRefwhere
Self: PyClassImpl,
Source§impl Traverse for FrameObject
impl Traverse for FrameObject
Source§fn traverse(&self, tracer_fn: &mut TraverseFn<'_>)
fn traverse(&self, tracer_fn: &mut TraverseFn<'_>)
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>)
Auto Trait Implementations§
impl !Freeze for FrameObject
impl !RefUnwindSafe for FrameObject
impl !Send for FrameObject
impl !Sync for FrameObject
impl !UnwindSafe for FrameObject
impl Unpin for FrameObject
impl UnsafeUnpin for FrameObject
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
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> ⓘ
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> ⓘ
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