[][src]Trait pyo3::conversion::IntoPy

pub trait IntoPy<T>: Sized {
    pub fn into_py(self, py: Python<'_>) -> T;
}

Similar to std::convert::Into, just that it requires a gil token.

IntoPy<PyObject> (aka IntoPy<Py<PyAny>>) should be implemented to define a conversion from Rust to Python which can be used by most of PyO3's methods.

Required methods

pub fn into_py(self, py: Python<'_>) -> T[src]

Performs the conversion.

Loading content...

Implementations on Foreign Types

impl<T> IntoPy<Py<PyAny>> for Option<T> where
    T: IntoPy<PyObject>, 
[src]

impl IntoPy<Py<PyAny>> for ()[src]

impl<T> IntoPy<Py<PyAny>> for &T where
    T: AsPyPointer
[src]

impl IntoPy<Py<PyTuple>> for ()[src]

Converts () to an empty Python tuple.

impl IntoPy<Py<PyAny>> for bool[src]

impl<'a> IntoPy<Py<PyAny>> for &'a [u8][src]

impl<K, V, H> IntoPy<Py<PyAny>> for HashMap<K, V, H> where
    K: Hash + Eq + IntoPy<PyObject>,
    V: IntoPy<PyObject>,
    H: BuildHasher
[src]

impl<K, V> IntoPy<Py<PyAny>> for BTreeMap<K, V> where
    K: Eq + IntoPy<PyObject>,
    V: IntoPy<PyObject>, 
[src]

impl IntoPy<Py<PyAny>> for f64[src]

impl IntoPy<Py<PyAny>> for f32[src]

impl<T> IntoPy<Py<PyAny>> for [T; 0] where
    T: ToPyObject
[src]

impl<T> IntoPy<Py<PyAny>> for [T; 1] where
    T: ToPyObject
[src]

impl<T> IntoPy<Py<PyAny>> for [T; 2] where
    T: ToPyObject
[src]

impl<T> IntoPy<Py<PyAny>> for [T; 3] where
    T: ToPyObject
[src]

impl<T> IntoPy<Py<PyAny>> for [T; 4] where
    T: ToPyObject
[src]

impl<T> IntoPy<Py<PyAny>> for [T; 5] where
    T: ToPyObject
[src]

impl<T> IntoPy<Py<PyAny>> for [T; 6] where
    T: ToPyObject
[src]

impl<T> IntoPy<Py<PyAny>> for [T; 7] where
    T: ToPyObject
[src]

impl<T> IntoPy<Py<PyAny>> for [T; 8] where
    T: ToPyObject
[src]

impl<T> IntoPy<Py<PyAny>> for [T; 9] where
    T: ToPyObject
[src]

impl<T> IntoPy<Py<PyAny>> for [T; 10] where
    T: ToPyObject
[src]

impl<T> IntoPy<Py<PyAny>> for [T; 11] where
    T: ToPyObject
[src]

impl<T> IntoPy<Py<PyAny>> for [T; 12] where
    T: ToPyObject
[src]

impl<T> IntoPy<Py<PyAny>> for [T; 13] where
    T: ToPyObject
[src]

impl<T> IntoPy<Py<PyAny>> for [T; 14] where
    T: ToPyObject
[src]

impl<T> IntoPy<Py<PyAny>> for [T; 15] where
    T: ToPyObject
[src]

impl<T> IntoPy<Py<PyAny>> for [T; 16] where
    T: ToPyObject
[src]

impl<T> IntoPy<Py<PyAny>> for [T; 17] where
    T: ToPyObject
[src]

impl<T> IntoPy<Py<PyAny>> for [T; 18] where
    T: ToPyObject
[src]

impl<T> IntoPy<Py<PyAny>> for [T; 19] where
    T: ToPyObject
[src]

impl<T> IntoPy<Py<PyAny>> for [T; 20] where
    T: ToPyObject
[src]

impl<T> IntoPy<Py<PyAny>> for [T; 21] where
    T: ToPyObject
[src]

impl<T> IntoPy<Py<PyAny>> for [T; 22] where
    T: ToPyObject
[src]

impl<T> IntoPy<Py<PyAny>> for [T; 23] where
    T: ToPyObject
[src]

impl<T> IntoPy<Py<PyAny>> for [T; 24] where
    T: ToPyObject
[src]

impl<T> IntoPy<Py<PyAny>> for [T; 25] where
    T: ToPyObject
[src]

impl<T> IntoPy<Py<PyAny>> for [T; 26] where
    T: ToPyObject
[src]

impl<T> IntoPy<Py<PyAny>> for [T; 27] where
    T: ToPyObject
[src]

impl<T> IntoPy<Py<PyAny>> for [T; 28] where
    T: ToPyObject
[src]

impl<T> IntoPy<Py<PyAny>> for [T; 29] where
    T: ToPyObject
[src]

impl<T> IntoPy<Py<PyAny>> for [T; 30] where
    T: ToPyObject
[src]

impl<T> IntoPy<Py<PyAny>> for [T; 31] where
    T: ToPyObject
[src]

impl<T> IntoPy<Py<PyAny>> for [T; 32] where
    T: ToPyObject
[src]

impl<T> IntoPy<Py<PyAny>> for Vec<T> where
    T: IntoPy<PyObject>, 
[src]

impl IntoPy<Py<PyAny>> for i8[src]

impl IntoPy<Py<PyAny>> for u8[src]

impl IntoPy<Py<PyAny>> for i16[src]

impl IntoPy<Py<PyAny>> for u16[src]

impl IntoPy<Py<PyAny>> for i32[src]

impl IntoPy<Py<PyAny>> for u32[src]

impl IntoPy<Py<PyAny>> for i64[src]

impl IntoPy<Py<PyAny>> for isize[src]

impl IntoPy<Py<PyAny>> for usize[src]

impl IntoPy<Py<PyAny>> for u64[src]

impl IntoPy<Py<PyAny>> for i128[src]

impl IntoPy<Py<PyAny>> for u128[src]

impl<K, S> IntoPy<Py<PyAny>> for HashSet<K, S> where
    K: IntoPy<PyObject> + Eq + Hash,
    S: BuildHasher + Default
[src]

impl<K> IntoPy<Py<PyAny>> for BTreeSet<K> where
    K: IntoPy<PyObject> + Ord
[src]

impl<'a> IntoPy<Py<PyAny>> for &'a str[src]

impl IntoPy<Py<PyAny>> for char[src]

impl IntoPy<Py<PyAny>> for String[src]

impl<'a> IntoPy<Py<PyAny>> for &'a String[src]

impl<A: IntoPy<PyObject>> IntoPy<Py<PyAny>> for (A,)[src]

impl<A: IntoPy<PyObject>> IntoPy<Py<PyTuple>> for (A,)[src]

impl<A: IntoPy<PyObject>, B: IntoPy<PyObject>> IntoPy<Py<PyAny>> for (A, B)[src]

impl<A: IntoPy<PyObject>, B: IntoPy<PyObject>> IntoPy<Py<PyTuple>> for (A, B)[src]

impl<A: IntoPy<PyObject>, B: IntoPy<PyObject>, C: IntoPy<PyObject>> IntoPy<Py<PyAny>> for (A, B, C)[src]

impl<A: IntoPy<PyObject>, B: IntoPy<PyObject>, C: IntoPy<PyObject>> IntoPy<Py<PyTuple>> for (A, B, C)[src]

impl<A: IntoPy<PyObject>, B: IntoPy<PyObject>, C: IntoPy<PyObject>, D: IntoPy<PyObject>> IntoPy<Py<PyAny>> for (A, B, C, D)[src]

impl<A: IntoPy<PyObject>, B: IntoPy<PyObject>, C: IntoPy<PyObject>, D: IntoPy<PyObject>> IntoPy<Py<PyTuple>> for (A, B, C, D)[src]

impl<A: IntoPy<PyObject>, B: IntoPy<PyObject>, C: IntoPy<PyObject>, D: IntoPy<PyObject>, E: IntoPy<PyObject>> IntoPy<Py<PyAny>> for (A, B, C, D, E)[src]

impl<A: IntoPy<PyObject>, B: IntoPy<PyObject>, C: IntoPy<PyObject>, D: IntoPy<PyObject>, E: IntoPy<PyObject>> IntoPy<Py<PyTuple>> for (A, B, C, D, E)[src]

impl<A: IntoPy<PyObject>, B: IntoPy<PyObject>, C: IntoPy<PyObject>, D: IntoPy<PyObject>, E: IntoPy<PyObject>, F: IntoPy<PyObject>> IntoPy<Py<PyAny>> for (A, B, C, D, E, F)[src]

impl<A: IntoPy<PyObject>, B: IntoPy<PyObject>, C: IntoPy<PyObject>, D: IntoPy<PyObject>, E: IntoPy<PyObject>, F: IntoPy<PyObject>> IntoPy<Py<PyTuple>> for (A, B, C, D, E, F)[src]

impl<A: IntoPy<PyObject>, B: IntoPy<PyObject>, C: IntoPy<PyObject>, D: IntoPy<PyObject>, E: IntoPy<PyObject>, F: IntoPy<PyObject>, G: IntoPy<PyObject>> IntoPy<Py<PyAny>> for (A, B, C, D, E, F, G)[src]

impl<A: IntoPy<PyObject>, B: IntoPy<PyObject>, C: IntoPy<PyObject>, D: IntoPy<PyObject>, E: IntoPy<PyObject>, F: IntoPy<PyObject>, G: IntoPy<PyObject>> IntoPy<Py<PyTuple>> for (A, B, C, D, E, F, G)[src]

impl<A: IntoPy<PyObject>, B: IntoPy<PyObject>, C: IntoPy<PyObject>, D: IntoPy<PyObject>, E: IntoPy<PyObject>, F: IntoPy<PyObject>, G: IntoPy<PyObject>, H: IntoPy<PyObject>> IntoPy<Py<PyAny>> for (A, B, C, D, E, F, G, H)[src]

impl<A: IntoPy<PyObject>, B: IntoPy<PyObject>, C: IntoPy<PyObject>, D: IntoPy<PyObject>, E: IntoPy<PyObject>, F: IntoPy<PyObject>, G: IntoPy<PyObject>, H: IntoPy<PyObject>> IntoPy<Py<PyTuple>> for (A, B, C, D, E, F, G, H)[src]

impl<A: IntoPy<PyObject>, B: IntoPy<PyObject>, C: IntoPy<PyObject>, D: IntoPy<PyObject>, E: IntoPy<PyObject>, F: IntoPy<PyObject>, G: IntoPy<PyObject>, H: IntoPy<PyObject>, I: IntoPy<PyObject>> IntoPy<Py<PyAny>> for (A, B, C, D, E, F, G, H, I)[src]

impl<A: IntoPy<PyObject>, B: IntoPy<PyObject>, C: IntoPy<PyObject>, D: IntoPy<PyObject>, E: IntoPy<PyObject>, F: IntoPy<PyObject>, G: IntoPy<PyObject>, H: IntoPy<PyObject>, I: IntoPy<PyObject>> IntoPy<Py<PyTuple>> for (A, B, C, D, E, F, G, H, I)[src]

Loading content...

Implementors

impl IntoPy<Py<CancelledError>> for &CancelledError[src]

impl IntoPy<Py<IncompleteReadError>> for &IncompleteReadError[src]

impl IntoPy<Py<InvalidStateError>> for &InvalidStateError[src]

impl IntoPy<Py<LimitOverrunError>> for &LimitOverrunError[src]

impl IntoPy<Py<QueueEmpty>> for &QueueEmpty[src]

impl IntoPy<Py<QueueFull>> for &QueueFull[src]

impl IntoPy<Py<TimeoutError>> for &TimeoutError[src]

impl IntoPy<Py<gaierror>> for &gaierror[src]

impl IntoPy<Py<herror>> for &herror[src]

impl IntoPy<Py<timeout>> for &timeout[src]

impl IntoPy<Py<PyArithmeticError>> for &PyArithmeticError[src]

impl IntoPy<Py<PyAssertionError>> for &PyAssertionError[src]

impl IntoPy<Py<PyAttributeError>> for &PyAttributeError[src]

impl IntoPy<Py<PyBaseException>> for &PyBaseException[src]

impl IntoPy<Py<PyBlockingIOError>> for &PyBlockingIOError[src]

impl IntoPy<Py<PyBrokenPipeError>> for &PyBrokenPipeError[src]

impl IntoPy<Py<PyBufferError>> for &PyBufferError[src]

impl IntoPy<Py<PyChildProcessError>> for &PyChildProcessError[src]

impl IntoPy<Py<PyConnectionAbortedError>> for &PyConnectionAbortedError[src]

impl IntoPy<Py<PyConnectionError>> for &PyConnectionError[src]

impl IntoPy<Py<PyConnectionRefusedError>> for &PyConnectionRefusedError[src]

impl IntoPy<Py<PyConnectionResetError>> for &PyConnectionResetError[src]

impl IntoPy<Py<PyEOFError>> for &PyEOFError[src]

impl IntoPy<Py<PyEnvironmentError>> for &PyEnvironmentError[src]

impl IntoPy<Py<PyException>> for &PyException[src]

impl IntoPy<Py<PyFileExistsError>> for &PyFileExistsError[src]

impl IntoPy<Py<PyFileNotFoundError>> for &PyFileNotFoundError[src]

impl IntoPy<Py<PyFloatingPointError>> for &PyFloatingPointError[src]

impl IntoPy<Py<PyGeneratorExit>> for &PyGeneratorExit[src]

impl IntoPy<Py<PyIOError>> for &PyIOError[src]

impl IntoPy<Py<PyImportError>> for &PyImportError[src]

impl IntoPy<Py<PyIndexError>> for &PyIndexError[src]

impl IntoPy<Py<PyInterruptedError>> for &PyInterruptedError[src]

impl IntoPy<Py<PyIsADirectoryError>> for &PyIsADirectoryError[src]

impl IntoPy<Py<PyKeyError>> for &PyKeyError[src]

impl IntoPy<Py<PyKeyboardInterrupt>> for &PyKeyboardInterrupt[src]

impl IntoPy<Py<PyLookupError>> for &PyLookupError[src]

impl IntoPy<Py<PyMemoryError>> for &PyMemoryError[src]

impl IntoPy<Py<PyModuleNotFoundError>> for &PyModuleNotFoundError[src]

impl IntoPy<Py<PyNameError>> for &PyNameError[src]

impl IntoPy<Py<PyNotADirectoryError>> for &PyNotADirectoryError[src]

impl IntoPy<Py<PyNotImplementedError>> for &PyNotImplementedError[src]

impl IntoPy<Py<PyOSError>> for &PyOSError[src]

impl IntoPy<Py<PyOverflowError>> for &PyOverflowError[src]

impl IntoPy<Py<PyPermissionError>> for &PyPermissionError[src]

impl IntoPy<Py<PyProcessLookupError>> for &PyProcessLookupError[src]

impl IntoPy<Py<PyRecursionError>> for &PyRecursionError[src]

impl IntoPy<Py<PyReferenceError>> for &PyReferenceError[src]

impl IntoPy<Py<PyRuntimeError>> for &PyRuntimeError[src]

impl IntoPy<Py<PyStopAsyncIteration>> for &PyStopAsyncIteration[src]

impl IntoPy<Py<PyStopIteration>> for &PyStopIteration[src]

impl IntoPy<Py<PySyntaxError>> for &PySyntaxError[src]

impl IntoPy<Py<PySystemError>> for &PySystemError[src]

impl IntoPy<Py<PySystemExit>> for &PySystemExit[src]

impl IntoPy<Py<PyTimeoutError>> for &PyTimeoutError[src]

impl IntoPy<Py<PyTypeError>> for &PyTypeError[src]

impl IntoPy<Py<PyUnboundLocalError>> for &PyUnboundLocalError[src]

impl IntoPy<Py<PyUnicodeDecodeError>> for &PyUnicodeDecodeError[src]

impl IntoPy<Py<PyUnicodeEncodeError>> for &PyUnicodeEncodeError[src]

impl IntoPy<Py<PyUnicodeError>> for &PyUnicodeError[src]

impl IntoPy<Py<PyUnicodeTranslateError>> for &PyUnicodeTranslateError[src]

impl IntoPy<Py<PyValueError>> for &PyValueError[src]

impl IntoPy<Py<PyZeroDivisionError>> for &PyZeroDivisionError[src]

impl IntoPy<Py<PanicException>> for &PanicException[src]

impl IntoPy<Py<PyAny>> for PyErr[src]

impl IntoPy<Py<PyModule>> for &PyModule[src]

impl IntoPy<Py<PyBool>> for &PyBool[src]

impl IntoPy<Py<PyByteArray>> for &PyByteArray[src]

impl IntoPy<Py<PyBytes>> for &PyBytes[src]

impl IntoPy<Py<PyCFunction>> for &PyCFunction[src]

impl IntoPy<Py<PyComplex>> for &PyComplex[src]

impl IntoPy<Py<PyDate>> for &PyDate[src]

impl IntoPy<Py<PyDateTime>> for &PyDateTime[src]

impl IntoPy<Py<PyDelta>> for &PyDelta[src]

impl IntoPy<Py<PyDict>> for &PyDict[src]

impl IntoPy<Py<PyFloat>> for &PyFloat[src]

impl IntoPy<Py<PyFrozenSet>> for &PyFrozenSet[src]

impl IntoPy<Py<PyFunction>> for &PyFunction[src]

impl IntoPy<Py<PyIterator>> for &PyIterator[src]

impl IntoPy<Py<PyList>> for &PyList[src]

impl IntoPy<Py<PyLong>> for &PyLong[src]

impl IntoPy<Py<PySequence>> for &PySequence[src]

impl IntoPy<Py<PySet>> for &PySet[src]

impl IntoPy<Py<PySlice>> for &PySlice[src]

impl IntoPy<Py<PyString>> for &PyString[src]

impl IntoPy<Py<PyTime>> for &PyTime[src]

impl IntoPy<Py<PyTuple>> for &PyTuple[src]

impl IntoPy<Py<PyType>> for &PyType[src]

impl IntoPy<Py<PyTzInfo>> for &PyTzInfo[src]

impl<'a> IntoPy<Py<PyAny>> for &'a PyErr[src]

impl<T> IntoPy<Py<PyAny>> for Py<T>[src]

pub fn into_py(self, _py: Python<'_>) -> PyObject[src]

Converts a Py instance to PyObject. Consumes self without calling Py_DECREF().

impl<T: PyClass> IntoPy<Py<PyAny>> for PyRef<'_, T>[src]

impl<T: PyClass> IntoPy<Py<PyAny>> for PyRefMut<'_, T>[src]

Loading content...