Skip to main content

PyClassTraverse

Trait PyClassTraverse 

Source
pub trait PyClassTraverse<T> {
    // Required method
    fn __traverse__(
        self,
        this: &T,
        visit: PyVisit<'_>,
    ) -> Result<(), PyTraverseError>;
}
Expand description

Autoref specialization point for __traverse__ implementations.

Type parameter T is necessary to make the trait local to the implementing crate.

Required Methods§

Source

fn __traverse__( self, this: &T, visit: PyVisit<'_>, ) -> Result<(), PyTraverseError>

self is used for autoref specialization of PyClassImplCollector and &PyClassImplCollector. this is the instance of the class being traversed.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<T> PyClassTraverse<T> for &PyClassImplCollector<T>

Fallback implementation for types without a __traverse__ pymethod.

⚠️ Internal Docs ⚠️ Not Public API 👉 Official Docs Here