Trait pyo3::conversion::FromPyPointer [−][src]
Raw level conversion between *mut ffi::PyObject
and PyO3 types.
Required methods
unsafe fn from_owned_ptr_or_opt(
py: Python<'p>,
ptr: *mut PyObject
) -> Option<&'p Self>
[src]
py: Python<'p>,
ptr: *mut PyObject
) -> Option<&'p Self>
Convert from an arbitrary PyObject
.
Safety
Implementations must ensure the object does not get freed during 'p
and ensure that ptr
is of the correct type.
Note that it must be safe to decrement the reference count of ptr
.
unsafe fn from_borrowed_ptr_or_opt(
py: Python<'p>,
ptr: *mut PyObject
) -> Option<&'p Self>
[src]
py: Python<'p>,
ptr: *mut PyObject
) -> Option<&'p Self>
Convert from an arbitrary borrowed PyObject
.
Safety
Implementations must ensure the object does not get freed during 'p
and avoid type confusion.
Provided methods
unsafe fn from_owned_ptr_or_panic(
py: Python<'p>,
ptr: *mut PyObject
) -> &'p Self
[src]
py: Python<'p>,
ptr: *mut PyObject
) -> &'p Self
unsafe fn from_owned_ptr(py: Python<'p>, ptr: *mut PyObject) -> &'p Self
[src]
unsafe fn from_owned_ptr_or_err(
py: Python<'p>,
ptr: *mut PyObject
) -> PyResult<&'p Self>
[src]
py: Python<'p>,
ptr: *mut PyObject
) -> PyResult<&'p Self>
unsafe fn from_borrowed_ptr_or_panic(
py: Python<'p>,
ptr: *mut PyObject
) -> &'p Self
[src]
py: Python<'p>,
ptr: *mut PyObject
) -> &'p Self
unsafe fn from_borrowed_ptr(py: Python<'p>, ptr: *mut PyObject) -> &'p Self
[src]
unsafe fn from_borrowed_ptr_or_err(
py: Python<'p>,
ptr: *mut PyObject
) -> PyResult<&'p Self>
[src]
py: Python<'p>,
ptr: *mut PyObject
) -> PyResult<&'p Self>
Implementors
impl<'p, T> FromPyPointer<'p> for T where
T: 'p + PyNativeType,
[src]
T: 'p + PyNativeType,