pub unsafe trait HasPyGilRef {
    type AsRefTarget: PyNativeType;
Expand description

Specifies that this type has a “GIL-bound Reference” form.

This is expected to be deprecated in the near future, see


  • Py<Self>::as_ref will hand out references to Self::AsRefTarget.
  • Self::AsRefTarget must have the same layout as UnsafeCell<ffi::PyAny>.

Required Associated Types§


type AsRefTarget: PyNativeType

Utility type to make Py::as_ref work.