pub trait MaybeTraverse {
const HAS_TRAVERSE: bool = false;
const HAS_CLEAR: bool = false;
// Required method
fn try_traverse(&self, traverse_fn: &mut TraverseFn<'_>);
// Provided method
fn try_clear(&mut self, _out: &mut Vec<PyObjectRef>) { ... }
}Expand description
This trait is used as a “Optional Trait”(I ’d like to use Trace? but it’s not allowed yet) for PyObjectPayload type
impl for PyObjectPayload, pyclass proc macro will handle the actual dispatch if type impl Trace
Every PyObjectPayload impl MaybeTrace, which may or may not be traceable
Provided Associated Constants§
Sourceconst HAS_TRAVERSE: bool = false
const HAS_TRAVERSE: bool = false
if is traceable, will be used by vtable to determine
Required Methods§
fn try_traverse(&self, traverse_fn: &mut TraverseFn<'_>)
Provided Methods§
fn try_clear(&mut self, _out: &mut Vec<PyObjectRef>)
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.