pub trait PyPayload: Debug + MaybeTraverse + PyThreadingConstraint + Sized + 'static {
// Required method
fn class(ctx: &Context) -> &'static Py<PyType>;
// Provided methods
fn into_pyobject(self, vm: &VirtualMachine) -> PyObjectRef { ... }
fn _into_ref(self, cls: PyTypeRef, ctx: &Context) -> PyRef<Self> { ... }
fn into_exact_ref(self, ctx: &Context) -> PyRefExact<Self> { ... }
fn into_ref(self, ctx: &Context) -> PyRef<Self> { ... }
fn into_ref_with_type(
self,
vm: &VirtualMachine,
cls: PyTypeRef
) -> PyResult<PyRef<Self>> { ... }
}