[−][src]Trait pyo3::conversion::AsPyPointer
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
pub fn as_ptr(&self) -> *mut PyObject
[src]
Retrieves the underlying FFI pointer (as a borrowed pointer).
Implementations on Foreign Types
impl<T> AsPyPointer for Option<T> where
T: AsPyPointer,
[src]
T: AsPyPointer,
Convert None
into a null pointer.
Implementors
impl AsPyPointer for CancelledError
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl AsPyPointer for IncompleteReadError
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl AsPyPointer for InvalidStateError
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl AsPyPointer for LimitOverrunError
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl AsPyPointer for QueueEmpty
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl AsPyPointer for QueueFull
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl AsPyPointer for TimeoutError
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl AsPyPointer for gaierror
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl AsPyPointer for herror
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl AsPyPointer for timeout
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl AsPyPointer for PyArithmeticError
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl AsPyPointer for PyAssertionError
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl AsPyPointer for PyAttributeError
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl AsPyPointer for PyBaseException
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl AsPyPointer for PyBlockingIOError
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl AsPyPointer for PyBrokenPipeError
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl AsPyPointer for PyBufferError
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl AsPyPointer for PyChildProcessError
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl AsPyPointer for PyConnectionAbortedError
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl AsPyPointer for PyConnectionError
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl AsPyPointer for PyConnectionRefusedError
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl AsPyPointer for PyConnectionResetError
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl AsPyPointer for PyEOFError
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl AsPyPointer for PyEnvironmentError
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl AsPyPointer for PyException
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl AsPyPointer for PyFileExistsError
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl AsPyPointer for PyFileNotFoundError
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl AsPyPointer for PyFloatingPointError
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl AsPyPointer for PyGeneratorExit
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl AsPyPointer for PyIOError
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl AsPyPointer for PyImportError
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl AsPyPointer for PyIndexError
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl AsPyPointer for PyInterruptedError
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl AsPyPointer for PyIsADirectoryError
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl AsPyPointer for PyKeyError
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl AsPyPointer for PyKeyboardInterrupt
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl AsPyPointer for PyLookupError
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl AsPyPointer for PyMemoryError
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl AsPyPointer for PyModuleNotFoundError
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl AsPyPointer for PyNameError
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl AsPyPointer for PyNotADirectoryError
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl AsPyPointer for PyNotImplementedError
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl AsPyPointer for PyOSError
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl AsPyPointer for PyOverflowError
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl AsPyPointer for PyPermissionError
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl AsPyPointer for PyProcessLookupError
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl AsPyPointer for PyRecursionError
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl AsPyPointer for PyReferenceError
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl AsPyPointer for PyRuntimeError
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl AsPyPointer for PyStopAsyncIteration
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl AsPyPointer for PyStopIteration
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl AsPyPointer for PySyntaxError
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl AsPyPointer for PySystemError
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl AsPyPointer for PySystemExit
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl AsPyPointer for PyTimeoutError
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl AsPyPointer for PyTypeError
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl AsPyPointer for PyUnboundLocalError
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl AsPyPointer for PyUnicodeDecodeError
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl AsPyPointer for PyUnicodeEncodeError
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl AsPyPointer for PyUnicodeError
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl AsPyPointer for PyUnicodeTranslateError
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl AsPyPointer for PyValueError
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl AsPyPointer for PyZeroDivisionError
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl AsPyPointer for PanicException
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl AsPyPointer for PyAny
[src]
impl AsPyPointer for PyModule
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl AsPyPointer for PyBool
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl AsPyPointer for PyByteArray
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl AsPyPointer for PyBytes
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl AsPyPointer for PyCFunction
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl AsPyPointer for PyComplex
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl AsPyPointer for PyDate
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl AsPyPointer for PyDateTime
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl AsPyPointer for PyDelta
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl AsPyPointer for PyDict
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl AsPyPointer for PyFloat
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl AsPyPointer for PyFrozenSet
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl AsPyPointer for PyFunction
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl AsPyPointer for PyList
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl AsPyPointer for PyLong
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl AsPyPointer for PySequence
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl AsPyPointer for PySet
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl AsPyPointer for PySlice
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl AsPyPointer for PyString
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl AsPyPointer for PyTime
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl AsPyPointer for PyTuple
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl AsPyPointer for PyType
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl AsPyPointer for PyTzInfo
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.
impl<'a, T: PyClass> AsPyPointer for PyRef<'a, T>
[src]
impl<'a, T: PyClass> AsPyPointer for PyRefMut<'a, T>
[src]
impl<T> AsPyPointer for Py<T>
[src]
pub fn as_ptr(&self) -> *mut PyObject
[src]
Gets the underlying FFI pointer, returns a borrowed pointer.