pub unsafe fn cast_non_null_function_argument<'py>(
py: Python<'py>,
raw_arg: NonNull<PyObject>,
) -> Borrowed<'py, 'py, PyAny>Expand description
Cast a NonNull<ffi::PyObject> to a PyArg. This is used to access safer PyO3
APIs with the assumption that the borrowed argument is valid for the lifetime 'py.
This has the effect of limiting the lifetime of function arguments to 'py, i.e.
avoiding accidentally creating 'static lifetimes from raw pointers.
§Safety
raw_argmust be a validNonNull<ffi::PyObject>for the lifetime'py.