devela::_dep::pyo3::conversion

Trait ToPyObject

pub trait ToPyObject {
    // Required method
    fn to_object(&self, py: Python<'_>) -> Py<PyAny>;
}
👎Deprecated since 0.23.0: ToPyObject is going to be replaced by IntoPyObject. See the migration guide (https://pyo3.rs/v0.23.0/migration) for more information.
Available on crate features dep_pyo3 and std only.
Expand description

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

Required Methods§

fn to_object(&self, py: Python<'_>) -> Py<PyAny>

👎Deprecated since 0.23.0: ToPyObject is going to be replaced by IntoPyObject. See the migration guide (https://pyo3.rs/v0.23.0/migration) for more information.

Converts self into a Python object.

Implementations on Foreign Types§

§

impl ToPyObject for bool

Converts a Rust bool to a Python bool.

§

fn to_object(&self, py: Python<'_>) -> Py<PyAny>

👎Deprecated since 0.23.0: ToPyObject is going to be replaced by IntoPyObject. See the migration guide (https://pyo3.rs/v0.23.0/migration) for more information.
§

impl ToPyObject for char

§

fn to_object(&self, py: Python<'_>) -> Py<PyAny>

👎Deprecated since 0.23.0: ToPyObject is going to be replaced by IntoPyObject. See the migration guide (https://pyo3.rs/v0.23.0/migration) for more information.
§

impl ToPyObject for f32

§

fn to_object(&self, py: Python<'_>) -> Py<PyAny>

👎Deprecated since 0.23.0: ToPyObject is going to be replaced by IntoPyObject. See the migration guide (https://pyo3.rs/v0.23.0/migration) for more information.
§

impl ToPyObject for f64

§

fn to_object(&self, py: Python<'_>) -> Py<PyAny>

👎Deprecated since 0.23.0: ToPyObject is going to be replaced by IntoPyObject. See the migration guide (https://pyo3.rs/v0.23.0/migration) for more information.
§

impl ToPyObject for i8

§

fn to_object(&self, py: Python<'_>) -> Py<PyAny>

👎Deprecated since 0.23.0: ToPyObject is going to be replaced by IntoPyObject. See the migration guide (https://pyo3.rs/v0.23.0/migration) for more information.
§

impl ToPyObject for i16

§

fn to_object(&self, py: Python<'_>) -> Py<PyAny>

👎Deprecated since 0.23.0: ToPyObject is going to be replaced by IntoPyObject. See the migration guide (https://pyo3.rs/v0.23.0/migration) for more information.
§

impl ToPyObject for i32

§

fn to_object(&self, py: Python<'_>) -> Py<PyAny>

👎Deprecated since 0.23.0: ToPyObject is going to be replaced by IntoPyObject. See the migration guide (https://pyo3.rs/v0.23.0/migration) for more information.
§

impl ToPyObject for i64

§

fn to_object(&self, py: Python<'_>) -> Py<PyAny>

👎Deprecated since 0.23.0: ToPyObject is going to be replaced by IntoPyObject. See the migration guide (https://pyo3.rs/v0.23.0/migration) for more information.
§

impl ToPyObject for i128

§

fn to_object(&self, py: Python<'_>) -> Py<PyAny>

👎Deprecated since 0.23.0: ToPyObject is going to be replaced by IntoPyObject. See the migration guide (https://pyo3.rs/v0.23.0/migration) for more information.
§

impl ToPyObject for isize

§

fn to_object(&self, py: Python<'_>) -> Py<PyAny>

👎Deprecated since 0.23.0: ToPyObject is going to be replaced by IntoPyObject. See the migration guide (https://pyo3.rs/v0.23.0/migration) for more information.
§

impl ToPyObject for str

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

§

fn to_object(&self, py: Python<'_>) -> Py<PyAny>

👎Deprecated since 0.23.0: ToPyObject is going to be replaced by IntoPyObject. See the migration guide (https://pyo3.rs/v0.23.0/migration) for more information.
§

impl ToPyObject for u8

§

fn to_object(&self, py: Python<'_>) -> Py<PyAny>

👎Deprecated since 0.23.0: ToPyObject is going to be replaced by IntoPyObject. See the migration guide (https://pyo3.rs/v0.23.0/migration) for more information.
§

impl ToPyObject for u16

§

fn to_object(&self, py: Python<'_>) -> Py<PyAny>

👎Deprecated since 0.23.0: ToPyObject is going to be replaced by IntoPyObject. See the migration guide (https://pyo3.rs/v0.23.0/migration) for more information.
§

impl ToPyObject for u32

§

fn to_object(&self, py: Python<'_>) -> Py<PyAny>

👎Deprecated since 0.23.0: ToPyObject is going to be replaced by IntoPyObject. See the migration guide (https://pyo3.rs/v0.23.0/migration) for more information.
§

impl ToPyObject for u64

§

fn to_object(&self, py: Python<'_>) -> Py<PyAny>

👎Deprecated since 0.23.0: ToPyObject is going to be replaced by IntoPyObject. See the migration guide (https://pyo3.rs/v0.23.0/migration) for more information.
§

impl ToPyObject for u128

§

fn to_object(&self, py: Python<'_>) -> Py<PyAny>

👎Deprecated since 0.23.0: ToPyObject is going to be replaced by IntoPyObject. See the migration guide (https://pyo3.rs/v0.23.0/migration) for more information.
§

impl ToPyObject for ()

() is converted to Python None.

§

fn to_object(&self, py: Python<'_>) -> Py<PyAny>

👎Deprecated since 0.23.0: ToPyObject is going to be replaced by IntoPyObject. See the migration guide (https://pyo3.rs/v0.23.0/migration) for more information.
§

impl ToPyObject for usize

§

fn to_object(&self, py: Python<'_>) -> Py<PyAny>

👎Deprecated since 0.23.0: ToPyObject is going to be replaced by IntoPyObject. See the migration guide (https://pyo3.rs/v0.23.0/migration) for more information.
§

impl<T0> ToPyObject for (T0,)
where T0: ToPyObject,

§

fn to_object(&self, py: Python<'_>) -> Py<PyAny>

👎Deprecated since 0.23.0: ToPyObject is going to be replaced by IntoPyObject. See the migration guide (https://pyo3.rs/v0.23.0/migration) for more information.
§

impl<T0, T1> ToPyObject for (T0, T1)
where T0: ToPyObject, T1: ToPyObject,

§

fn to_object(&self, py: Python<'_>) -> Py<PyAny>

👎Deprecated since 0.23.0: ToPyObject is going to be replaced by IntoPyObject. See the migration guide (https://pyo3.rs/v0.23.0/migration) for more information.
§

impl<T0, T1, T2> ToPyObject for (T0, T1, T2)
where T0: ToPyObject, T1: ToPyObject, T2: ToPyObject,

§

fn to_object(&self, py: Python<'_>) -> Py<PyAny>

👎Deprecated since 0.23.0: ToPyObject is going to be replaced by IntoPyObject. See the migration guide (https://pyo3.rs/v0.23.0/migration) for more information.
§

impl<T0, T1, T2, T3> ToPyObject for (T0, T1, T2, T3)
where T0: ToPyObject, T1: ToPyObject, T2: ToPyObject, T3: ToPyObject,

§

fn to_object(&self, py: Python<'_>) -> Py<PyAny>

👎Deprecated since 0.23.0: ToPyObject is going to be replaced by IntoPyObject. See the migration guide (https://pyo3.rs/v0.23.0/migration) for more information.
§

impl<T0, T1, T2, T3, T4> ToPyObject for (T0, T1, T2, T3, T4)
where T0: ToPyObject, T1: ToPyObject, T2: ToPyObject, T3: ToPyObject, T4: ToPyObject,

§

fn to_object(&self, py: Python<'_>) -> Py<PyAny>

👎Deprecated since 0.23.0: ToPyObject is going to be replaced by IntoPyObject. See the migration guide (https://pyo3.rs/v0.23.0/migration) for more information.
§

impl<T0, T1, T2, T3, T4, T5> ToPyObject for (T0, T1, T2, T3, T4, T5)
where T0: ToPyObject, T1: ToPyObject, T2: ToPyObject, T3: ToPyObject, T4: ToPyObject, T5: ToPyObject,

§

fn to_object(&self, py: Python<'_>) -> Py<PyAny>

👎Deprecated since 0.23.0: ToPyObject is going to be replaced by IntoPyObject. See the migration guide (https://pyo3.rs/v0.23.0/migration) for more information.
§

impl<T0, T1, T2, T3, T4, T5, T6> ToPyObject for (T0, T1, T2, T3, T4, T5, T6)
where T0: ToPyObject, T1: ToPyObject, T2: ToPyObject, T3: ToPyObject, T4: ToPyObject, T5: ToPyObject, T6: ToPyObject,

§

fn to_object(&self, py: Python<'_>) -> Py<PyAny>

👎Deprecated since 0.23.0: ToPyObject is going to be replaced by IntoPyObject. See the migration guide (https://pyo3.rs/v0.23.0/migration) for more information.
§

impl<T0, T1, T2, T3, T4, T5, T6, T7> ToPyObject for (T0, T1, T2, T3, T4, T5, T6, T7)

§

fn to_object(&self, py: Python<'_>) -> Py<PyAny>

👎Deprecated since 0.23.0: ToPyObject is going to be replaced by IntoPyObject. See the migration guide (https://pyo3.rs/v0.23.0/migration) for more information.
§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8> ToPyObject for (T0, T1, T2, T3, T4, T5, T6, T7, T8)

§

fn to_object(&self, py: Python<'_>) -> Py<PyAny>

👎Deprecated since 0.23.0: ToPyObject is going to be replaced by IntoPyObject. See the migration guide (https://pyo3.rs/v0.23.0/migration) for more information.
§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> ToPyObject for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9)

§

fn to_object(&self, py: Python<'_>) -> Py<PyAny>

👎Deprecated since 0.23.0: ToPyObject is going to be replaced by IntoPyObject. See the migration guide (https://pyo3.rs/v0.23.0/migration) for more information.
§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> ToPyObject for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)

§

fn to_object(&self, py: Python<'_>) -> Py<PyAny>

👎Deprecated since 0.23.0: ToPyObject is going to be replaced by IntoPyObject. See the migration guide (https://pyo3.rs/v0.23.0/migration) for more information.
§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> ToPyObject for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)

§

fn to_object(&self, py: Python<'_>) -> Py<PyAny>

👎Deprecated since 0.23.0: ToPyObject is going to be replaced by IntoPyObject. See the migration guide (https://pyo3.rs/v0.23.0/migration) for more information.
§

impl<T> ToPyObject for &T
where T: ToPyObject + ?Sized,

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

§

fn to_object(&self, py: Python<'_>) -> Py<PyAny>

👎Deprecated since 0.23.0: ToPyObject is going to be replaced by IntoPyObject. See the migration guide (https://pyo3.rs/v0.23.0/migration) for more information.
§

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

§

fn to_object(&self, py: Python<'_>) -> Py<PyAny>

👎Deprecated since 0.23.0: ToPyObject is going to be replaced by IntoPyObject. See the migration guide (https://pyo3.rs/v0.23.0/migration) for more information.
§

impl<T, const N: usize> ToPyObject for [T; N]
where T: ToPyObject,

§

fn to_object(&self, py: Python<'_>) -> Py<PyAny>

👎Deprecated since 0.23.0: ToPyObject is going to be replaced by IntoPyObject. See the migration guide (https://pyo3.rs/v0.23.0/migration) for more information.

Implementors§

§

impl ToPyObject for IpAddr

§

impl ToPyObject for Cow<'_, str>

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

§

impl ToPyObject for Cow<'_, Path>

§

impl ToPyObject for Cow<'_, OsStr>

§

impl ToPyObject for Cow<'_, [u8]>

§

impl ToPyObject for Ipv4Addr

§

impl ToPyObject for Ipv6Addr

§

impl ToPyObject for NonZero<i8>

§

impl ToPyObject for NonZero<i16>

§

impl ToPyObject for NonZero<i32>

§

impl ToPyObject for NonZero<i64>

§

impl ToPyObject for NonZero<i128>

§

impl ToPyObject for NonZero<isize>

§

impl ToPyObject for NonZero<u8>

§

impl ToPyObject for NonZero<u16>

§

impl ToPyObject for NonZero<u32>

§

impl ToPyObject for NonZero<u64>

§

impl ToPyObject for NonZero<u128>

§

impl ToPyObject for NonZero<usize>

§

impl ToPyObject for Path

§

impl ToPyObject for PathBuf

§

impl ToPyObject for String

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

§

impl ToPyObject for OsStr

§

impl ToPyObject for OsString

§

impl ToPyObject for Duration

§

impl ToPyObject for SystemTime

§

impl ToPyObject for PyBackedBytes

§

impl ToPyObject for PyBackedStr

§

impl ToPyObject for PyErr

§

impl ToPyObject for PySliceIndices

§

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

§

impl<K, V, H> ToPyObject for devela::all::HashMap<K, V, H>
where K: Hash + Eq + ToPyObject, V: ToPyObject, H: BuildHasher,

§

impl<K, V, H> ToPyObject for devela::_dep::_std::collections::HashMap<K, V, H>
where K: Hash + Eq + ToPyObject, V: ToPyObject, H: BuildHasher,

§

impl<T> ToPyObject for Option<T>
where T: ToPyObject,

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

§

impl<T> ToPyObject for BTreeSet<T>
where T: Hash + Eq + ToPyObject,

§

impl<T> ToPyObject for Cell<T>
where T: Copy + ToPyObject,

§

impl<T> ToPyObject for devela::all::HashSet<T>
where T: Hash + Eq + ToPyObject,

§

impl<T> ToPyObject for Vec<T>
where T: ToPyObject,

§

impl<T> ToPyObject for Borrowed<'_, '_, T>

§

impl<T> ToPyObject for Bound<'_, T>

§

impl<T> ToPyObject for Py<T>

§

impl<T, S> ToPyObject for devela::_dep::_std::collections::HashSet<T, S>
where T: Hash + Eq + ToPyObject, S: BuildHasher + Default,