Trait pyo3::conversion::AsPyPointer [−][src]
Expand description
This trait represents that we can do zero-cost conversion from the object to a FFI pointer.
This trait is implemented for types that internally wrap a pointer to a Python object.
Example
use pyo3::{AsPyPointer, prelude::*};
let gil = Python::acquire_gil();
let dict = pyo3::types::PyDict::new(gil.python());
// All native object wrappers implement AsPyPointer!!!
assert_ne!(dict.as_ptr(), std::ptr::null_mut());
Required methods
Implementations on Foreign Types
Convert None
into a null pointer.