The PyCapsule type has an import method that returns a reference. But creating a reference from the capsule pointer might not be sound for all capsules. It might be useful to have an import_raw method that returns a PyResult<NonNull<c_void>>.
impl PyCapsule {
fn import_raw(py: Python<'_>, name: &CStr) -> PyResult<NonNull<c_void>>);
}
The
PyCapsuletype has animportmethod that returns a reference. But creating a reference from the capsule pointer might not be sound for all capsules. It might be useful to have animport_rawmethod that returns aPyResult<NonNull<c_void>>.