Trait pyo3::pyclass_slots::PyClassWeakRef[][src]

pub trait PyClassWeakRef {
    const IS_DUMMY: bool;

    fn new() -> Self;
fn __private__(&self) -> PrivateMarker; unsafe fn clear_weakrefs(&mut self, _obj: *mut PyObject, _py: Python<'_>) { ... } }
Expand description

Represents the __weakref__ field for #[pyclass].

Associated Constants

Whether this weakref type is capable of holding weak references.

Required methods

Initializes a weakref instance.

This trait is private to implement; this method exists to make it impossible to implement outside the crate.

Provided methods

Clears the weak references to the given object.

Safety
  • _obj must be a pointer to the pyclass instance which contains self.
  • The GIL must be held.

Implementors