pyo3::conversion

Trait IntoPyObject

source
pub trait IntoPyObject<'py>: Sized {
    type Target;
    type Output: BoundObject<'py, Self::Target>;
    type Error: Into<PyErr>;

    // Required method
    fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>;
}
Expand description

Defines a conversion from a Rust type to a Python object, which may fail.

It functions similarly to std’s TryInto trait, but requires a GIL token as an argument.

Required Associated Types§

source

type Target

The Python output type

source

type Output: BoundObject<'py, Self::Target>

The smart pointer type to use.

This will usually be [Bound<'py, Target>], but in special cases [Borrowed<'a, 'py, Target>] can be used to minimize reference counting overhead.

source

type Error: Into<PyErr>

The type returned in the event of a conversion error.

Required Methods§

source

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

Performs the conversion.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<'a, 'py, A> IntoPyObject<'py> for &'a SmallVec<A>
where A: Array, &'a A::Item: IntoPyObject<'py>,

source§

type Target = PyAny

source§

type Output = Bound<'py, <&'a SmallVec<A> as IntoPyObject<'py>>::Target>

source§

type Error = PyErr

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

source§

impl<'a, 'py, K> IntoPyObject<'py> for &'a BTreeSet<K>
where &'a K: IntoPyObject<'py> + Ord,

source§

type Target = PySet

source§

type Output = Bound<'py, <&'a BTreeSet<K> as IntoPyObject<'py>>::Target>

source§

type Error = PyErr

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

source§

impl<'a, 'py, K, H> IntoPyObject<'py> for &'a HashSet<K, H>
where &'a K: IntoPyObject<'py> + Eq + Hash, H: BuildHasher,

source§

type Target = PySet

source§

type Output = Bound<'py, <&'a HashSet<K, H> as IntoPyObject<'py>>::Target>

source§

type Error = PyErr

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

source§

impl<'a, 'py, K, H> IntoPyObject<'py> for &'a HashSet<K, H>
where &'a K: IntoPyObject<'py> + Eq + Hash, H: BuildHasher,

source§

type Target = PySet

source§

type Output = Bound<'py, <&'a HashSet<K, H> as IntoPyObject<'py>>::Target>

source§

type Error = PyErr

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

source§

impl<'a, 'py, K, V> IntoPyObject<'py> for &'a BTreeMap<K, V>
where &'a K: IntoPyObject<'py> + Eq, &'a V: IntoPyObject<'py>,

source§

type Target = PyDict

source§

type Output = Bound<'py, <&'a BTreeMap<K, V> as IntoPyObject<'py>>::Target>

source§

type Error = PyErr

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

source§

impl<'a, 'py, K, V, H> IntoPyObject<'py> for &'a HashMap<K, V, H>
where &'a K: IntoPyObject<'py> + Eq + Hash, &'a V: IntoPyObject<'py>, H: BuildHasher,

source§

type Target = PyDict

source§

type Output = Bound<'py, <&'a HashMap<K, V, H> as IntoPyObject<'py>>::Target>

source§

type Error = PyErr

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

source§

impl<'a, 'py, K, V, H> IntoPyObject<'py> for &'a HashMap<K, V, H>
where &'a K: IntoPyObject<'py> + Eq + Hash, &'a V: IntoPyObject<'py>, H: BuildHasher,

source§

type Target = PyDict

source§

type Output = Bound<'py, <&'a HashMap<K, V, H> as IntoPyObject<'py>>::Target>

source§

type Error = PyErr

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

source§

impl<'a, 'py, K, V, H> IntoPyObject<'py> for &'a IndexMap<K, V, H>
where &'a K: IntoPyObject<'py> + Eq + Hash, &'a V: IntoPyObject<'py>, H: BuildHasher,

source§

type Target = PyDict

source§

type Output = Bound<'py, <&'a IndexMap<K, V, H> as IntoPyObject<'py>>::Target>

source§

type Error = PyErr

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

source§

impl<'a, 'py, L, R> IntoPyObject<'py> for &'a Either<L, R>
where &'a L: IntoPyObject<'py>, &'a R: IntoPyObject<'py>,

source§

type Target = PyAny

source§

type Output = Bound<'py, <&'a Either<L, R> as IntoPyObject<'py>>::Target>

source§

type Error = PyErr

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

source§

impl<'a, 'py, T0> IntoPyObject<'py> for &'a (T0,)
where &'a T0: IntoPyObject<'py>,

source§

type Target = PyTuple

source§

type Output = Bound<'py, <&'a (T0,) as IntoPyObject<'py>>::Target>

source§

type Error = PyErr

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

source§

impl<'a, 'py, T0, T1> IntoPyObject<'py> for &'a (T0, T1)

source§

type Target = PyTuple

source§

type Output = Bound<'py, <&'a (T0, T1) as IntoPyObject<'py>>::Target>

source§

type Error = PyErr

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

source§

impl<'a, 'py, T0, T1, T2> IntoPyObject<'py> for &'a (T0, T1, T2)

source§

type Target = PyTuple

source§

type Output = Bound<'py, <&'a (T0, T1, T2) as IntoPyObject<'py>>::Target>

source§

type Error = PyErr

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

source§

impl<'a, 'py, T0, T1, T2, T3> IntoPyObject<'py> for &'a (T0, T1, T2, T3)

source§

impl<'a, 'py, T0, T1, T2, T3, T4> IntoPyObject<'py> for &'a (T0, T1, T2, T3, T4)

source§

impl<'a, 'py, T0, T1, T2, T3, T4, T5> IntoPyObject<'py> for &'a (T0, T1, T2, T3, T4, T5)

source§

impl<'a, 'py, T0, T1, T2, T3, T4, T5, T6> IntoPyObject<'py> for &'a (T0, T1, T2, T3, T4, T5, T6)

source§

impl<'a, 'py, T0, T1, T2, T3, T4, T5, T6, T7> IntoPyObject<'py> for &'a (T0, T1, T2, T3, T4, T5, T6, T7)

source§

impl<'a, 'py, T0, T1, T2, T3, T4, T5, T6, T7, T8> IntoPyObject<'py> for &'a (T0, T1, T2, T3, T4, T5, T6, T7, T8)

source§

impl<'a, 'py, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> IntoPyObject<'py> for &'a (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9)

source§

impl<'a, 'py, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> IntoPyObject<'py> for &'a (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)

source§

impl<'a, 'py, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> IntoPyObject<'py> for &'a (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)

source§

impl<'a, 'py, T> IntoPyObject<'py> for &'a Option<T>
where &'a T: IntoPyObject<'py>,

source§

type Target = PyAny

source§

type Output = Bound<'py, <&'a Option<T> as IntoPyObject<'py>>::Target>

source§

type Error = <&'a T as IntoPyObject<'py>>::Error

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

source§

impl<'a, 'py, T> IntoPyObject<'py> for &'a [T]
where &'a T: IntoPyObject<'py>,

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

Turns &[u8] into PyBytes, all other Ts will be turned into a PyList

source§

type Target = PyAny

source§

type Output = Bound<'py, <&'a [T] as IntoPyObject<'py>>::Target>

source§

type Error = PyErr

source§

impl<'a, 'py, T> IntoPyObject<'py> for &'a Vec<T>
where &'a T: IntoPyObject<'py>,

source§

type Target = PyAny

source§

type Output = Bound<'py, <&'a Vec<T> as IntoPyObject<'py>>::Target>

source§

type Error = PyErr

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

source§

impl<'a, 'py, T, const N: usize> IntoPyObject<'py> for &'a [T; N]
where &'a T: IntoPyObject<'py>,

source§

type Target = PyAny

source§

type Output = Bound<'py, <&'a [T; N] as IntoPyObject<'py>>::Target>

source§

type Error = PyErr

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

source§

impl<'py> IntoPyObject<'py> for &&str

source§

type Target = PyString

source§

type Output = Bound<'py, <&&str as IntoPyObject<'py>>::Target>

source§

type Error = Infallible

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

source§

impl<'py> IntoPyObject<'py> for &&OsStr

source§

impl<'py> IntoPyObject<'py> for &&Path

source§

impl<'py> IntoPyObject<'py> for &Cow<'_, str>

source§

type Target = PyString

source§

type Output = Bound<'py, <&Cow<'_, str> as IntoPyObject<'py>>::Target>

source§

type Error = Infallible

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

source§

impl<'py> IntoPyObject<'py> for &Cow<'_, OsStr>

source§

type Target = PyString

source§

type Output = Bound<'py, <&Cow<'_, OsStr> as IntoPyObject<'py>>::Target>

source§

type Error = Infallible

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

source§

impl<'py> IntoPyObject<'py> for &Cow<'_, Path>

source§

type Target = PyString

source§

type Output = Bound<'py, <&Cow<'_, Path> as IntoPyObject<'py>>::Target>

source§

type Error = Infallible

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

source§

impl<'py> IntoPyObject<'py> for &IpAddr

source§

type Target = PyAny

source§

type Output = Bound<'py, <&IpAddr as IntoPyObject<'py>>::Target>

source§

type Error = PyErr

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

source§

impl<'py> IntoPyObject<'py> for &bool

source§

type Target = PyBool

source§

type Output = Borrowed<'py, 'py, <&bool as IntoPyObject<'py>>::Target>

source§

type Error = Infallible

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

source§

impl<'py> IntoPyObject<'py> for &char

source§

impl<'py> IntoPyObject<'py> for &f32

source§

impl<'py> IntoPyObject<'py> for &f64

source§

impl<'py> IntoPyObject<'py> for &i8

source§

type Target = PyInt

source§

type Output = Bound<'py, <&i8 as IntoPyObject<'py>>::Target>

source§

type Error = Infallible

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

source§

impl<'py> IntoPyObject<'py> for &i16

source§

type Target = PyInt

source§

type Output = Bound<'py, <&i16 as IntoPyObject<'py>>::Target>

source§

type Error = Infallible

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

source§

impl<'py> IntoPyObject<'py> for &i32

source§

type Target = PyInt

source§

type Output = Bound<'py, <&i32 as IntoPyObject<'py>>::Target>

source§

type Error = Infallible

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

source§

impl<'py> IntoPyObject<'py> for &i64

source§

type Target = PyInt

source§

type Output = Bound<'py, <&i64 as IntoPyObject<'py>>::Target>

source§

type Error = Infallible

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

source§

impl<'py> IntoPyObject<'py> for &i128

source§

type Target = PyInt

source§

type Output = Bound<'py, <&i128 as IntoPyObject<'py>>::Target>

source§

type Error = Infallible

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

source§

impl<'py> IntoPyObject<'py> for &isize

source§

impl<'py> IntoPyObject<'py> for &str

source§

impl<'py> IntoPyObject<'py> for &u8

source§

type Target = PyInt

source§

type Output = Bound<'py, <&u8 as IntoPyObject<'py>>::Target>

source§

type Error = Infallible

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

source§

impl<'py> IntoPyObject<'py> for &u16

source§

type Target = PyInt

source§

type Output = Bound<'py, <&u16 as IntoPyObject<'py>>::Target>

source§

type Error = Infallible

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

source§

impl<'py> IntoPyObject<'py> for &u32

source§

type Target = PyInt

source§

type Output = Bound<'py, <&u32 as IntoPyObject<'py>>::Target>

source§

type Error = Infallible

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

source§

impl<'py> IntoPyObject<'py> for &u64

source§

type Target = PyInt

source§

type Output = Bound<'py, <&u64 as IntoPyObject<'py>>::Target>

source§

type Error = Infallible

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

source§

impl<'py> IntoPyObject<'py> for &u128

source§

type Target = PyInt

source§

type Output = Bound<'py, <&u128 as IntoPyObject<'py>>::Target>

source§

type Error = Infallible

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

source§

impl<'py> IntoPyObject<'py> for &usize

source§

impl<'py> IntoPyObject<'py> for &String

source§

impl<'py> IntoPyObject<'py> for &Ipv4Addr

source§

type Target = PyAny

source§

type Output = Bound<'py, <&Ipv4Addr as IntoPyObject<'py>>::Target>

source§

type Error = PyErr

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

source§

impl<'py> IntoPyObject<'py> for &Ipv6Addr

source§

type Target = PyAny

source§

type Output = Bound<'py, <&Ipv6Addr as IntoPyObject<'py>>::Target>

source§

type Error = PyErr

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

source§

impl<'py> IntoPyObject<'py> for &Duration

source§

impl<'py> IntoPyObject<'py> for &OsStr

source§

impl<'py> IntoPyObject<'py> for &OsString

source§

impl<'py> IntoPyObject<'py> for &Path

source§

impl<'py> IntoPyObject<'py> for &PathBuf

source§

impl<'py> IntoPyObject<'py> for &SystemTime

source§

impl<'py> IntoPyObject<'py> for &NaiveDate

source§

impl<'py> IntoPyObject<'py> for &NaiveDateTime

source§

impl<'py> IntoPyObject<'py> for &NaiveTime

source§

impl<'py> IntoPyObject<'py> for &FixedOffset

source§

impl<'py> IntoPyObject<'py> for &Utc

source§

type Target = PyTzInfo

source§

type Output = Bound<'py, <&Utc as IntoPyObject<'py>>::Target>

source§

type Error = PyErr

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

source§

impl<'py> IntoPyObject<'py> for &BigInt

source§

type Target = PyInt

source§

type Output = Bound<'py, <&BigInt as IntoPyObject<'py>>::Target>

source§

type Error = PyErr

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

source§

impl<'py> IntoPyObject<'py> for &BigUint

source§

type Target = PyInt

source§

type Output = Bound<'py, <&BigUint as IntoPyObject<'py>>::Target>

source§

type Error = PyErr

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

source§

impl<'py> IntoPyObject<'py> for &Complex<f32>

source§

impl<'py> IntoPyObject<'py> for &Complex<f64>

source§

impl<'py> IntoPyObject<'py> for &Ratio<i8>

source§

type Target = PyAny

source§

type Output = Bound<'py, <&Ratio<i8> as IntoPyObject<'py>>::Target>

source§

type Error = PyErr

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

source§

impl<'py> IntoPyObject<'py> for &Ratio<i16>

source§

type Target = PyAny

source§

type Output = Bound<'py, <&Ratio<i16> as IntoPyObject<'py>>::Target>

source§

type Error = PyErr

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

source§

impl<'py> IntoPyObject<'py> for &Ratio<i32>

source§

type Target = PyAny

source§

type Output = Bound<'py, <&Ratio<i32> as IntoPyObject<'py>>::Target>

source§

type Error = PyErr

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

source§

impl<'py> IntoPyObject<'py> for &Ratio<i64>

source§

type Target = PyAny

source§

type Output = Bound<'py, <&Ratio<i64> as IntoPyObject<'py>>::Target>

source§

type Error = PyErr

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

source§

impl<'py> IntoPyObject<'py> for &Ratio<isize>

source§

type Target = PyAny

source§

type Output = Bound<'py, <&Ratio<isize> as IntoPyObject<'py>>::Target>

source§

type Error = PyErr

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

source§

impl<'py> IntoPyObject<'py> for &Ratio<BigInt>

source§

type Target = PyAny

source§

type Output = Bound<'py, <&Ratio<BigInt> as IntoPyObject<'py>>::Target>

source§

type Error = PyErr

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

source§

impl<'py> IntoPyObject<'py> for &NonZeroI8

source§

impl<'py> IntoPyObject<'py> for &NonZeroI16

source§

impl<'py> IntoPyObject<'py> for &NonZeroI32

source§

impl<'py> IntoPyObject<'py> for &NonZeroI64

source§

impl<'py> IntoPyObject<'py> for &NonZeroI128

source§

impl<'py> IntoPyObject<'py> for &NonZeroIsize

source§

impl<'py> IntoPyObject<'py> for &NonZeroU8

source§

impl<'py> IntoPyObject<'py> for &NonZeroU16

source§

impl<'py> IntoPyObject<'py> for &NonZeroU32

source§

impl<'py> IntoPyObject<'py> for &NonZeroU64

source§

impl<'py> IntoPyObject<'py> for &NonZeroU128

source§

impl<'py> IntoPyObject<'py> for &NonZeroUsize

source§

impl<'py> IntoPyObject<'py> for &Duration

source§

impl<'py> IntoPyObject<'py> for &Decimal

source§

type Target = PyAny

source§

type Output = Bound<'py, <&Decimal as IntoPyObject<'py>>::Target>

source§

type Error = PyErr

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

source§

impl<'py> IntoPyObject<'py> for Cow<'_, str>

source§

type Target = PyString

source§

type Output = Bound<'py, <Cow<'_, str> as IntoPyObject<'py>>::Target>

source§

type Error = Infallible

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

source§

impl<'py> IntoPyObject<'py> for Cow<'_, OsStr>

source§

type Target = PyString

source§

type Output = Bound<'py, <Cow<'_, OsStr> as IntoPyObject<'py>>::Target>

source§

type Error = Infallible

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

source§

impl<'py> IntoPyObject<'py> for Cow<'_, Path>

source§

type Target = PyString

source§

type Output = Bound<'py, <Cow<'_, Path> as IntoPyObject<'py>>::Target>

source§

type Error = Infallible

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

source§

impl<'py> IntoPyObject<'py> for IpAddr

source§

type Target = PyAny

source§

type Output = Bound<'py, <IpAddr as IntoPyObject<'py>>::Target>

source§

type Error = PyErr

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

source§

impl<'py> IntoPyObject<'py> for bool

source§

type Target = PyBool

source§

type Output = Borrowed<'py, 'py, <bool as IntoPyObject<'py>>::Target>

source§

type Error = Infallible

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

source§

impl<'py> IntoPyObject<'py> for char

source§

impl<'py> IntoPyObject<'py> for f32

source§

impl<'py> IntoPyObject<'py> for f64

source§

impl<'py> IntoPyObject<'py> for i8

source§

type Target = PyInt

source§

type Output = Bound<'py, <i8 as IntoPyObject<'py>>::Target>

source§

type Error = Infallible

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

source§

impl<'py> IntoPyObject<'py> for i16

source§

type Target = PyInt

source§

type Output = Bound<'py, <i16 as IntoPyObject<'py>>::Target>

source§

type Error = Infallible

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

source§

impl<'py> IntoPyObject<'py> for i32

source§

type Target = PyInt

source§

type Output = Bound<'py, <i32 as IntoPyObject<'py>>::Target>

source§

type Error = Infallible

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

source§

impl<'py> IntoPyObject<'py> for i64

source§

type Target = PyInt

source§

type Output = Bound<'py, <i64 as IntoPyObject<'py>>::Target>

source§

type Error = Infallible

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

source§

impl<'py> IntoPyObject<'py> for i128

source§

impl<'py> IntoPyObject<'py> for isize

source§

impl<'py> IntoPyObject<'py> for u8

source§

type Target = PyInt

source§

type Output = Bound<'py, <u8 as IntoPyObject<'py>>::Target>

source§

type Error = Infallible

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

source§

impl<'py> IntoPyObject<'py> for u16

source§

type Target = PyInt

source§

type Output = Bound<'py, <u16 as IntoPyObject<'py>>::Target>

source§

type Error = Infallible

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

source§

impl<'py> IntoPyObject<'py> for u32

source§

type Target = PyInt

source§

type Output = Bound<'py, <u32 as IntoPyObject<'py>>::Target>

source§

type Error = Infallible

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

source§

impl<'py> IntoPyObject<'py> for u64

source§

type Target = PyInt

source§

type Output = Bound<'py, <u64 as IntoPyObject<'py>>::Target>

source§

type Error = Infallible

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

source§

impl<'py> IntoPyObject<'py> for u128

source§

impl<'py> IntoPyObject<'py> for ()

source§

impl<'py> IntoPyObject<'py> for usize

source§

impl<'py> IntoPyObject<'py> for String

source§

impl<'py> IntoPyObject<'py> for Ipv4Addr

source§

type Target = PyAny

source§

type Output = Bound<'py, <Ipv4Addr as IntoPyObject<'py>>::Target>

source§

type Error = PyErr

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

source§

impl<'py> IntoPyObject<'py> for Ipv6Addr

source§

type Target = PyAny

source§

type Output = Bound<'py, <Ipv6Addr as IntoPyObject<'py>>::Target>

source§

type Error = PyErr

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

source§

impl<'py> IntoPyObject<'py> for Duration

source§

impl<'py> IntoPyObject<'py> for OsString

source§

impl<'py> IntoPyObject<'py> for PathBuf

source§

impl<'py> IntoPyObject<'py> for SystemTime

source§

impl<'py> IntoPyObject<'py> for NaiveDate

source§

impl<'py> IntoPyObject<'py> for NaiveDateTime

source§

impl<'py> IntoPyObject<'py> for NaiveTime

source§

impl<'py> IntoPyObject<'py> for FixedOffset

source§

impl<'py> IntoPyObject<'py> for Utc

source§

type Target = PyTzInfo

source§

type Output = Bound<'py, <Utc as IntoPyObject<'py>>::Target>

source§

type Error = PyErr

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

source§

impl<'py> IntoPyObject<'py> for BigInt

source§

type Target = PyInt

source§

type Output = Bound<'py, <BigInt as IntoPyObject<'py>>::Target>

source§

type Error = PyErr

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

source§

impl<'py> IntoPyObject<'py> for BigUint

source§

type Target = PyInt

source§

type Output = Bound<'py, <BigUint as IntoPyObject<'py>>::Target>

source§

type Error = PyErr

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

source§

impl<'py> IntoPyObject<'py> for Complex<f32>

source§

impl<'py> IntoPyObject<'py> for Complex<f64>

source§

impl<'py> IntoPyObject<'py> for Ratio<i8>

source§

type Target = PyAny

source§

type Output = Bound<'py, <Ratio<i8> as IntoPyObject<'py>>::Target>

source§

type Error = PyErr

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

source§

impl<'py> IntoPyObject<'py> for Ratio<i16>

source§

type Target = PyAny

source§

type Output = Bound<'py, <Ratio<i16> as IntoPyObject<'py>>::Target>

source§

type Error = PyErr

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

source§

impl<'py> IntoPyObject<'py> for Ratio<i32>

source§

type Target = PyAny

source§

type Output = Bound<'py, <Ratio<i32> as IntoPyObject<'py>>::Target>

source§

type Error = PyErr

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

source§

impl<'py> IntoPyObject<'py> for Ratio<i64>

source§

type Target = PyAny

source§

type Output = Bound<'py, <Ratio<i64> as IntoPyObject<'py>>::Target>

source§

type Error = PyErr

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

source§

impl<'py> IntoPyObject<'py> for Ratio<isize>

source§

type Target = PyAny

source§

type Output = Bound<'py, <Ratio<isize> as IntoPyObject<'py>>::Target>

source§

type Error = PyErr

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

source§

impl<'py> IntoPyObject<'py> for Ratio<BigInt>

source§

type Target = PyAny

source§

type Output = Bound<'py, <Ratio<BigInt> as IntoPyObject<'py>>::Target>

source§

type Error = PyErr

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

source§

impl<'py> IntoPyObject<'py> for NonZeroI8

source§

impl<'py> IntoPyObject<'py> for NonZeroI16

source§

impl<'py> IntoPyObject<'py> for NonZeroI32

source§

impl<'py> IntoPyObject<'py> for NonZeroI64

source§

impl<'py> IntoPyObject<'py> for NonZeroI128

source§

impl<'py> IntoPyObject<'py> for NonZeroIsize

source§

impl<'py> IntoPyObject<'py> for NonZeroU8

source§

impl<'py> IntoPyObject<'py> for NonZeroU16

source§

impl<'py> IntoPyObject<'py> for NonZeroU32

source§

impl<'py> IntoPyObject<'py> for NonZeroU64

source§

impl<'py> IntoPyObject<'py> for NonZeroU128

source§

impl<'py> IntoPyObject<'py> for NonZeroUsize

source§

impl<'py> IntoPyObject<'py> for Duration

source§

impl<'py> IntoPyObject<'py> for Decimal

source§

type Target = PyAny

source§

type Output = Bound<'py, <Decimal as IntoPyObject<'py>>::Target>

source§

type Error = PyErr

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

source§

impl<'py, A> IntoPyObject<'py> for SmallVec<A>
where A: Array, A::Item: IntoPyObject<'py>,

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

Turns [SmallVec<u8>] into PyBytes, all other Ts will be turned into a PyList

source§

type Target = PyAny

source§

type Output = Bound<'py, <SmallVec<A> as IntoPyObject<'py>>::Target>

source§

type Error = PyErr

source§

impl<'py, K> IntoPyObject<'py> for BTreeSet<K>
where K: IntoPyObject<'py> + Ord,

source§

type Target = PySet

source§

type Output = Bound<'py, <BTreeSet<K> as IntoPyObject<'py>>::Target>

source§

type Error = PyErr

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

source§

impl<'py, K, H> IntoPyObject<'py> for HashSet<K, H>
where K: IntoPyObject<'py> + Eq + Hash, H: BuildHasher,

source§

type Target = PySet

source§

type Output = Bound<'py, <HashSet<K, H> as IntoPyObject<'py>>::Target>

source§

type Error = PyErr

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

source§

impl<'py, K, S> IntoPyObject<'py> for HashSet<K, S>
where K: IntoPyObject<'py> + Eq + Hash, S: BuildHasher + Default,

source§

type Target = PySet

source§

type Output = Bound<'py, <HashSet<K, S> as IntoPyObject<'py>>::Target>

source§

type Error = PyErr

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

source§

impl<'py, K, V> IntoPyObject<'py> for BTreeMap<K, V>
where K: IntoPyObject<'py> + Eq, V: IntoPyObject<'py>,

source§

type Target = PyDict

source§

type Output = Bound<'py, <BTreeMap<K, V> as IntoPyObject<'py>>::Target>

source§

type Error = PyErr

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

source§

impl<'py, K, V, H> IntoPyObject<'py> for HashMap<K, V, H>
where K: IntoPyObject<'py> + Eq + Hash, V: IntoPyObject<'py>, H: BuildHasher,

source§

type Target = PyDict

source§

type Output = Bound<'py, <HashMap<K, V, H> as IntoPyObject<'py>>::Target>

source§

type Error = PyErr

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

source§

impl<'py, K, V, H> IntoPyObject<'py> for HashMap<K, V, H>
where K: IntoPyObject<'py> + Eq + Hash, V: IntoPyObject<'py>, H: BuildHasher,

source§

type Target = PyDict

source§

type Output = Bound<'py, <HashMap<K, V, H> as IntoPyObject<'py>>::Target>

source§

type Error = PyErr

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

source§

impl<'py, K, V, H> IntoPyObject<'py> for IndexMap<K, V, H>
where K: IntoPyObject<'py> + Eq + Hash, V: IntoPyObject<'py>, H: BuildHasher,

source§

type Target = PyDict

source§

type Output = Bound<'py, <IndexMap<K, V, H> as IntoPyObject<'py>>::Target>

source§

type Error = PyErr

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

source§

impl<'py, L, R> IntoPyObject<'py> for Either<L, R>
where L: IntoPyObject<'py>, R: IntoPyObject<'py>,

source§

type Target = PyAny

source§

type Output = Bound<'py, <Either<L, R> as IntoPyObject<'py>>::Target>

source§

type Error = PyErr

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

source§

impl<'py, T0> IntoPyObject<'py> for (T0,)
where T0: IntoPyObject<'py>,

source§

type Target = PyTuple

source§

type Output = Bound<'py, <(T0,) as IntoPyObject<'py>>::Target>

source§

type Error = PyErr

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

source§

impl<'py, T0, T1> IntoPyObject<'py> for (T0, T1)
where T0: IntoPyObject<'py>, T1: IntoPyObject<'py>,

source§

impl<'py, T0, T1, T2> IntoPyObject<'py> for (T0, T1, T2)
where T0: IntoPyObject<'py>, T1: IntoPyObject<'py>, T2: IntoPyObject<'py>,

source§

impl<'py, T0, T1, T2, T3> IntoPyObject<'py> for (T0, T1, T2, T3)
where T0: IntoPyObject<'py>, T1: IntoPyObject<'py>, T2: IntoPyObject<'py>, T3: IntoPyObject<'py>,

source§

impl<'py, T0, T1, T2, T3, T4> IntoPyObject<'py> for (T0, T1, T2, T3, T4)
where T0: IntoPyObject<'py>, T1: IntoPyObject<'py>, T2: IntoPyObject<'py>, T3: IntoPyObject<'py>, T4: IntoPyObject<'py>,

source§

impl<'py, T0, T1, T2, T3, T4, T5> IntoPyObject<'py> for (T0, T1, T2, T3, T4, T5)
where T0: IntoPyObject<'py>, T1: IntoPyObject<'py>, T2: IntoPyObject<'py>, T3: IntoPyObject<'py>, T4: IntoPyObject<'py>, T5: IntoPyObject<'py>,

source§

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

source§

impl<'py, T0, T1, T2, T3, T4, T5, T6, T7> IntoPyObject<'py> for (T0, T1, T2, T3, T4, T5, T6, T7)
where T0: IntoPyObject<'py>, T1: IntoPyObject<'py>, T2: IntoPyObject<'py>, T3: IntoPyObject<'py>, T4: IntoPyObject<'py>, T5: IntoPyObject<'py>, T6: IntoPyObject<'py>, T7: IntoPyObject<'py>,

source§

impl<'py, T0, T1, T2, T3, T4, T5, T6, T7, T8> IntoPyObject<'py> for (T0, T1, T2, T3, T4, T5, T6, T7, T8)
where T0: IntoPyObject<'py>, T1: IntoPyObject<'py>, T2: IntoPyObject<'py>, T3: IntoPyObject<'py>, T4: IntoPyObject<'py>, T5: IntoPyObject<'py>, T6: IntoPyObject<'py>, T7: IntoPyObject<'py>, T8: IntoPyObject<'py>,

source§

impl<'py, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> IntoPyObject<'py> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9)
where T0: IntoPyObject<'py>, T1: IntoPyObject<'py>, T2: IntoPyObject<'py>, T3: IntoPyObject<'py>, T4: IntoPyObject<'py>, T5: IntoPyObject<'py>, T6: IntoPyObject<'py>, T7: IntoPyObject<'py>, T8: IntoPyObject<'py>, T9: IntoPyObject<'py>,

source§

impl<'py, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> IntoPyObject<'py> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)
where T0: IntoPyObject<'py>, T1: IntoPyObject<'py>, T2: IntoPyObject<'py>, T3: IntoPyObject<'py>, T4: IntoPyObject<'py>, T5: IntoPyObject<'py>, T6: IntoPyObject<'py>, T7: IntoPyObject<'py>, T8: IntoPyObject<'py>, T9: IntoPyObject<'py>, T10: IntoPyObject<'py>,

source§

impl<'py, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> IntoPyObject<'py> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)
where T0: IntoPyObject<'py>, T1: IntoPyObject<'py>, T2: IntoPyObject<'py>, T3: IntoPyObject<'py>, T4: IntoPyObject<'py>, T5: IntoPyObject<'py>, T6: IntoPyObject<'py>, T7: IntoPyObject<'py>, T8: IntoPyObject<'py>, T9: IntoPyObject<'py>, T10: IntoPyObject<'py>, T11: IntoPyObject<'py>,

source§

impl<'py, T> IntoPyObject<'py> for Cow<'_, [T]>
where T: Clone, for<'a> &'a T: IntoPyObject<'py>,

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

Turns Cow<[u8]> into PyBytes, all other Ts will be turned into a PyList

source§

type Target = PyAny

source§

type Output = Bound<'py, <Cow<'_, [T]> as IntoPyObject<'py>>::Target>

source§

type Error = PyErr

source§

impl<'py, T> IntoPyObject<'py> for Option<T>
where T: IntoPyObject<'py>,

source§

type Target = PyAny

source§

type Output = Bound<'py, <Option<T> as IntoPyObject<'py>>::Target>

source§

type Error = <T as IntoPyObject<'py>>::Error

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

source§

impl<'py, T> IntoPyObject<'py> for Vec<T>
where T: IntoPyObject<'py>,

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

Turns Vec<u8> into PyBytes, all other Ts will be turned into a PyList

source§

type Target = PyAny

source§

type Output = Bound<'py, <Vec<T> as IntoPyObject<'py>>::Target>

source§

type Error = PyErr

source§

impl<'py, T, const N: usize> IntoPyObject<'py> for [T; N]
where T: IntoPyObject<'py>,

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

Turns [u8; N] into PyBytes, all other Ts will be turned into a PyList

source§

type Target = PyAny

source§

type Output = Bound<'py, <[T; N] as IntoPyObject<'py>>::Target>

source§

type Error = PyErr

source§

impl<'py, T: Copy + IntoPyObject<'py>> IntoPyObject<'py> for &Cell<T>

source§

type Target = <T as IntoPyObject<'py>>::Target

source§

type Output = <T as IntoPyObject<'py>>::Output

source§

type Error = <T as IntoPyObject<'py>>::Error

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

source§

impl<'py, T: Copy + IntoPyObject<'py>> IntoPyObject<'py> for Cell<T>

source§

type Target = <T as IntoPyObject<'py>>::Target

source§

type Output = <T as IntoPyObject<'py>>::Output

source§

type Error = <T as IntoPyObject<'py>>::Error

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

source§

impl<'py, Tz: TimeZone> IntoPyObject<'py> for &DateTime<Tz>

source§

type Target = PyDateTime

source§

type Output = Bound<'py, <&DateTime<Tz> as IntoPyObject<'py>>::Target>

source§

type Error = PyErr

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

source§

impl<'py, Tz: TimeZone> IntoPyObject<'py> for DateTime<Tz>

source§

type Target = PyDateTime

source§

type Output = Bound<'py, <DateTime<Tz> as IntoPyObject<'py>>::Target>

source§

type Error = PyErr

source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

Implementors§

source§

impl<'a, 'py, T> IntoPyObject<'py> for &'a Bound<'py, T>

source§

type Target = T

source§

type Output = Borrowed<'a, 'py, <&'a Bound<'py, T> as IntoPyObject<'py>>::Target>

source§

type Error = Infallible

source§

impl<'a, 'py, T> IntoPyObject<'py> for &'a Py<T>

source§

type Target = T

source§

type Output = Borrowed<'a, 'py, <&'a Py<T> as IntoPyObject<'py>>::Target>

source§

type Error = Infallible

source§

impl<'a, 'py, T> IntoPyObject<'py> for &Borrowed<'a, 'py, T>

source§

type Target = T

source§

type Output = Borrowed<'a, 'py, <&Borrowed<'a, 'py, T> as IntoPyObject<'py>>::Target>

source§

type Error = Infallible

source§

impl<'a, 'py, T> IntoPyObject<'py> for Borrowed<'a, 'py, T>

source§

type Target = T

source§

type Output = Borrowed<'a, 'py, <Borrowed<'a, 'py, T> as IntoPyObject<'py>>::Target>

source§

type Error = Infallible

source§

impl<'a, 'py, T: PyClass> IntoPyObject<'py> for &'a PyRef<'py, T>

source§

impl<'a, 'py, T: PyClass<Frozen = False>> IntoPyObject<'py> for &'a PyRefMut<'py, T>

source§

impl<'py> IntoPyObject<'py> for &PyErr

source§

impl<'py> IntoPyObject<'py> for &PyBackedBytes

source§

impl<'py> IntoPyObject<'py> for &PyBackedStr

source§

impl<'py> IntoPyObject<'py> for &PySliceIndices

source§

impl<'py> IntoPyObject<'py> for Coroutine

source§

impl<'py> IntoPyObject<'py> for PyErr

source§

impl<'py> IntoPyObject<'py> for PyBackedBytes

source§

impl<'py> IntoPyObject<'py> for PyBackedStr

source§

impl<'py> IntoPyObject<'py> for PySliceIndices

source§

impl<'py, T> IntoPyObject<'py> for Bound<'py, T>

source§

type Target = T

source§

type Output = Bound<'py, <Bound<'py, T> as IntoPyObject<'py>>::Target>

source§

type Error = Infallible

source§

impl<'py, T> IntoPyObject<'py> for Py<T>

source§

impl<'py, T: PyClass> IntoPyObject<'py> for PyRef<'py, T>

source§

impl<'py, T: PyClass<Frozen = False>> IntoPyObject<'py> for PyRefMut<'py, T>