Skip to main content

traverse_impl

Function traverse_impl 

Source
unsafe fn traverse_impl<T>(
    slf: *mut PyObject,
    impl_: fn(&T, PyVisit<'_>) -> Result<(), PyTraverseError>,
    visit: visitproc,
    arg: *mut c_void,
    current_traverse: traverseproc,
) -> c_int
where T: PyClass,
Expand description

Visits the base type, the instance __dict__ and the pyclass’s own data, stopping as soon as one of them returns non-zero.

§Safety

  • slf must be a valid pointer to an instance of T.
  • Must only be called from _call_traverse, which holds the PanicTrap and ForbidAttaching lock this relies on.
⚠️ Internal Docs ⚠️ Not Public API 👉 Official Docs Here