Trait pyo3::impl_::pyclass::PyClassWeakRef

source ·
pub trait PyClassWeakRef {
    const INIT: Self;

    // Required method
    fn __private__(&self) -> PrivateMarker;

    // Provided method
    unsafe fn clear_weakrefs(&mut self, _obj: *mut PyObject, _py: Python<'_>) { ... }
}
Expand description

Represents the __weakref__ field for #[pyclass].

Required Associated Constants§

source

const INIT: Self

Initializes a weakref instance.

Required Methods§

source

fn __private__(&self) -> PrivateMarker

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

Provided Methods§

source

unsafe fn clear_weakrefs(&mut self, _obj: *mut PyObject, _py: Python<'_>)

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.

Object Safety§

This trait is not object safe.

Implementors§

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