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

pub trait IntoPy<T>: Sized {
    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

fn into_py(self, py: Python) -> T

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 IntoPy<Py<PyAny>> for Complex<f32>[src]

impl IntoPy<Py<PyAny>> for Complex<f64>[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 IntoPy<Py<PyAny>> for BigUint[src]

impl IntoPy<Py<PyAny>> for BigInt[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 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<PyBaseException>> for PyErr[src]

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

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<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<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<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<'_, T: PyClass> IntoPy<Py<PyAny>> for PyRef<'_, T>[src]

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

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

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

fn into_py(self, _py: Python) -> PyObject[src]

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

Loading content...