pub unsafe fn import<'py, T>(py: Python<'py>, name: &CStr) -> PyResult<&'py T> {
        let ptr = ffi::PyCapsule_Import(name.as_ptr(), false as c_int);
        if ptr.is_null() {
            Err(PyErr::fetch(py))
        } else {
            Ok(&*(ptr as *const T))
        }
    }
/// Imports an existing capsule.
///
/// The `name` should match the path to the module attribute exactly in the form
/// of `"module.attribute"`, which should be the same as the name within the capsule.
///
/// # Safety
///
/// It must be known that this capsule's value pointer is to an item of type `T`.
Imports an existing capsule.
The `name` should match the path to the module attribute exactly in the form
of `"module.attribute"`, which should be the same as the name within the capsule.
Imports an existing capsule . The ` name ` should match the path to the module attribute exactly in the form of ` " module . attribute " ` which should be the same as the name within the capsule .
pub unsafe fn import<'py, T>(py: Python<'py>, name: &CStr) -> PyResult<&'py T> {
        let ptr = ffi::PyCapsule_Import(name.as_ptr(), false as c_int);
        if ptr.is_null() {
            Err(PyErr::fetch(py))
        } else {
            Ok(&*(ptr as *const T))
        }
    }
pub unsafe fn import < ' py , T > ( py : Python < ' py > , name : & CStr ) -> PyResult < & ' py T > { let ptr = ffi :: PyCapsule_Import ( name . as_ptr ( ) , false as c_int ) ; if ptr . is_null ( ) { Err ( PyErr :: fetch ( py ) ) } else { Ok ( & * ( ptr as * const T ) ) } }
Imports an existing capsule.
Imports an existing capsule .
py
Python<'py>
name
&CStr
py
Python<'py>
name
&CStr
safety
It must be known that this capsule's value pointer is to an item of type `T`.
It must be known that this capsule ' s value pointer is to an item of type ` T ` .