pyo3::type_object

Trait HasPyGilRef

Source
pub unsafe trait HasPyGilRef {
    type AsRefTarget: PyNativeType;
}
Available on crate feature gil-refs only.
Expand description

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

This is expected to be deprecated in the near future, see https://github.com/PyO3/pyo3/issues/3382

§Safety

  • 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§

Source

type AsRefTarget: PyNativeType

Utility type to make Py::as_ref work.

Implementors§

Source§

impl HasPyGilRef for Coroutine

Available on crate feature experimental-async only.
Source§

impl<T> HasPyGilRef for T
where T: PyNativeType,