[][src]Trait pyo3::conversion::ToPyObject

pub trait ToPyObject {
    fn to_object(&self, py: Python) -> PyObject;
}

Conversion trait that allows various objects to be converted into PyObject.

Required methods

fn to_object(&self, py: Python) -> PyObject

Converts self into a Python object.

Loading content...

Implementations on Foreign Types

impl<'a, T: ?Sized> ToPyObject for &'a T where
    T: ToPyObject
[src]

Identity conversion: allows using existing PyObject instances where T: ToPyObject is expected.

impl<T> ToPyObject for Option<T> where
    T: ToPyObject
[src]

Option::Some<T> is converted like T. Option::None is converted to Python None.

impl ToPyObject for ()[src]

() is converted to Python None.

impl ToPyObject for bool[src]

Converts a Rust bool to a Python bool.

impl ToPyObject for Complex<f32>[src]

impl ToPyObject for Complex<f64>[src]

impl<K, V, H> ToPyObject for HashMap<K, V, H> where
    K: Hash + Eq + ToPyObject,
    V: ToPyObject,
    H: BuildHasher
[src]

impl<K, V> ToPyObject for BTreeMap<K, V> where
    K: Eq + ToPyObject,
    V: ToPyObject
[src]

impl ToPyObject for f64[src]

impl ToPyObject for f32[src]

impl<T> ToPyObject for [T] where
    T: ToPyObject
[src]

impl<T> ToPyObject for Vec<T> where
    T: ToPyObject
[src]

impl ToPyObject for i8[src]

impl ToPyObject for u8[src]

impl ToPyObject for i16[src]

impl ToPyObject for u16[src]

impl ToPyObject for i32[src]

impl ToPyObject for u32[src]

impl ToPyObject for i64[src]

impl ToPyObject for isize[src]

impl ToPyObject for usize[src]

impl ToPyObject for u64[src]

impl ToPyObject for i128[src]

impl ToPyObject for u128[src]

impl ToPyObject for BigUint[src]

impl ToPyObject for BigInt[src]

impl<T> ToPyObject for HashSet<T> where
    T: Hash + Eq + ToPyObject
[src]

impl<T> ToPyObject for BTreeSet<T> where
    T: Hash + Eq + ToPyObject
[src]

impl ToPyObject for str[src]

Converts a Rust str to a Python object. See PyString::new for details on the conversion.

impl<'a> ToPyObject for Cow<'a, str>[src]

Converts a Rust Cow<str> to a Python object. See PyString::new for details on the conversion.

impl ToPyObject for String[src]

Converts a Rust String to a Python object. See PyString::new for details on the conversion.

impl<A: ToPyObject> ToPyObject for (A,)[src]

impl<A: ToPyObject, B: ToPyObject> ToPyObject for (A, B)[src]

impl<A: ToPyObject, B: ToPyObject, C: ToPyObject> ToPyObject for (A, B, C)[src]

impl<A: ToPyObject, B: ToPyObject, C: ToPyObject, D: ToPyObject> ToPyObject for (A, B, C, D)[src]

impl<A: ToPyObject, B: ToPyObject, C: ToPyObject, D: ToPyObject, E: ToPyObject> ToPyObject for (A, B, C, D, E)[src]

impl<A: ToPyObject, B: ToPyObject, C: ToPyObject, D: ToPyObject, E: ToPyObject, F: ToPyObject> ToPyObject for (A, B, C, D, E, F)[src]

impl<A: ToPyObject, B: ToPyObject, C: ToPyObject, D: ToPyObject, E: ToPyObject, F: ToPyObject, G: ToPyObject> ToPyObject for (A, B, C, D, E, F, G)[src]

impl<A: ToPyObject, B: ToPyObject, C: ToPyObject, D: ToPyObject, E: ToPyObject, F: ToPyObject, G: ToPyObject, H: ToPyObject> ToPyObject for (A, B, C, D, E, F, G, H)[src]

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

Loading content...

Implementors

impl ToPyObject for CancelledError[src]

impl ToPyObject for IncompleteReadError[src]

impl ToPyObject for InvalidStateError[src]

impl ToPyObject for LimitOverrunError[src]

impl ToPyObject for QueueEmpty[src]

impl ToPyObject for QueueFull[src]

impl ToPyObject for TimeoutError[src]

impl ToPyObject for gaierror[src]

impl ToPyObject for herror[src]

impl ToPyObject for timeout[src]

impl ToPyObject for PyArithmeticError[src]

impl ToPyObject for PyAssertionError[src]

impl ToPyObject for PyAttributeError[src]

impl ToPyObject for PyBaseException[src]

impl ToPyObject for PyBlockingIOError[src]

impl ToPyObject for PyBrokenPipeError[src]

impl ToPyObject for PyBufferError[src]

impl ToPyObject for PyChildProcessError[src]

impl ToPyObject for PyConnectionAbortedError[src]

impl ToPyObject for PyConnectionError[src]

impl ToPyObject for PyConnectionRefusedError[src]

impl ToPyObject for PyConnectionResetError[src]

impl ToPyObject for PyEOFError[src]

impl ToPyObject for PyEnvironmentError[src]

impl ToPyObject for PyException[src]

impl ToPyObject for PyFileExistsError[src]

impl ToPyObject for PyFileNotFoundError[src]

impl ToPyObject for PyFloatingPointError[src]

impl ToPyObject for PyGeneratorExit[src]

impl ToPyObject for PyIOError[src]

impl ToPyObject for PyImportError[src]

impl ToPyObject for PyIndexError[src]

impl ToPyObject for PyInterruptedError[src]

impl ToPyObject for PyIsADirectoryError[src]

impl ToPyObject for PyKeyError[src]

impl ToPyObject for PyKeyboardInterrupt[src]

impl ToPyObject for PyLookupError[src]

impl ToPyObject for PyMemoryError[src]

impl ToPyObject for PyModuleNotFoundError[src]

impl ToPyObject for PyNameError[src]

impl ToPyObject for PyNotADirectoryError[src]

impl ToPyObject for PyNotImplementedError[src]

impl ToPyObject for PyOSError[src]

impl ToPyObject for PyOverflowError[src]

impl ToPyObject for PyPermissionError[src]

impl ToPyObject for PyProcessLookupError[src]

impl ToPyObject for PyRecursionError[src]

impl ToPyObject for PyReferenceError[src]

impl ToPyObject for PyRuntimeError[src]

impl ToPyObject for PyStopAsyncIteration[src]

impl ToPyObject for PyStopIteration[src]

impl ToPyObject for PySyntaxError[src]

impl ToPyObject for PySystemError[src]

impl ToPyObject for PySystemExit[src]

impl ToPyObject for PyTimeoutError[src]

impl ToPyObject for PyTypeError[src]

impl ToPyObject for PyUnboundLocalError[src]

impl ToPyObject for PyUnicodeDecodeError[src]

impl ToPyObject for PyUnicodeEncodeError[src]

impl ToPyObject for PyUnicodeError[src]

impl ToPyObject for PyUnicodeTranslateError[src]

impl ToPyObject for PyValueError[src]

impl ToPyObject for PyZeroDivisionError[src]

impl ToPyObject for PanicException[src]

impl ToPyObject for PyModule[src]

impl ToPyObject for PyAny[src]

impl ToPyObject for PyErr[src]

impl ToPyObject for PyBool[src]

impl ToPyObject for PyByteArray[src]

impl ToPyObject for PyBytes[src]

impl ToPyObject for PyComplex[src]

impl ToPyObject for PyDate[src]

impl ToPyObject for PyDateTime[src]

impl ToPyObject for PyDelta[src]

impl ToPyObject for PyDict[src]

impl ToPyObject for PyFloat[src]

impl ToPyObject for PyFrozenSet[src]

impl ToPyObject for PyList[src]

impl ToPyObject for PyLong[src]

impl ToPyObject for PySet[src]

impl ToPyObject for PySlice[src]

impl ToPyObject for PySliceIndices[src]

impl ToPyObject for PyString[src]

impl ToPyObject for PyTime[src]

impl ToPyObject for PyTuple[src]

impl ToPyObject for PyType[src]

impl ToPyObject for PyTzInfo[src]

impl<'_, T: PyClass> ToPyObject for &'_ PyCell<T>[src]

impl<T> ToPyObject for Py<T>[src]

fn to_object(&self, py: Python) -> PyObject[src]

Converts Py instance -> PyObject.

Loading content...