devela::_dep::pyo3::conversion

Trait IntoPyObject

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> ;
}
Available on crate features dep_pyo3 and std only.
Expand description

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

This trait has #[derive(IntoPyObject)] to automatically implement it for simple types and #[derive(IntoPyObjectRef)] to implement the same for references.

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

The into_pyobject method is designed for maximum flexibility and efficiency; it

  • allows for a concrete Python type to be returned (the Target associated type)
  • allows for the smart pointer containing the Python object to be either Bound<'py, Self::Target> or Borrowed<'a, 'py, Self::Target> to avoid unnecessary reference counting overhead
  • allows for a custom error type to be returned in the event of a conversion error to avoid unnecessarily creating a Python exception

§See also

  • The IntoPyObjectExt trait, which provides convenience methods for common usages of IntoPyObject which erase type information and convert errors to PyErr.

Required Associated Types§

type Target

The Python output type

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.

type Error: Into<PyErr>

The type returned in the event of a conversion error.

Required Methods§

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

Performs the conversion.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

§

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

§

type Target = PyTuple

§

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

§

type Error = PyErr

§

fn into_pyobject( self, py: Python<'py>, ) -> Result<<&'a (T0,) as IntoPyObject<'py>>::Output, <&'a (T0,) as IntoPyObject<'py>>::Error>

§

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

§

type Target = PyTuple

§

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

§

type Error = PyErr

§

fn into_pyobject( self, py: Python<'py>, ) -> Result<<&'a (T0, T1) as IntoPyObject<'py>>::Output, <&'a (T0, T1) as IntoPyObject<'py>>::Error>

§

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

§

type Target = PyTuple

§

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

§

type Error = PyErr

§

fn into_pyobject( self, py: Python<'py>, ) -> Result<<&'a (T0, T1, T2) as IntoPyObject<'py>>::Output, <&'a (T0, T1, T2) as IntoPyObject<'py>>::Error>

§

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

§

type Target = PyTuple

§

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

§

type Error = PyErr

§

fn into_pyobject( self, py: Python<'py>, ) -> Result<<&'a (T0, T1, T2, T3) as IntoPyObject<'py>>::Output, <&'a (T0, T1, T2, T3) as IntoPyObject<'py>>::Error>

§

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

§

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

§

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

§

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

§

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)
where &'a T0: IntoPyObject<'py>, &'a T1: IntoPyObject<'py>, &'a T2: IntoPyObject<'py>, &'a T3: IntoPyObject<'py>, &'a T4: IntoPyObject<'py>, &'a T5: IntoPyObject<'py>, &'a T6: IntoPyObject<'py>, &'a T7: IntoPyObject<'py>, &'a T8: IntoPyObject<'py>, T0: 'a, T1: 'a, T2: 'a, T3: 'a, T4: 'a, T5: 'a, T6: 'a, T7: 'a, T8: 'a,

§

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)
where &'a T0: IntoPyObject<'py>, &'a T1: IntoPyObject<'py>, &'a T2: IntoPyObject<'py>, &'a T3: IntoPyObject<'py>, &'a T4: IntoPyObject<'py>, &'a T5: IntoPyObject<'py>, &'a T6: IntoPyObject<'py>, &'a T7: IntoPyObject<'py>, &'a T8: IntoPyObject<'py>, &'a T9: IntoPyObject<'py>, T0: 'a, T1: 'a, T2: 'a, T3: 'a, T4: 'a, T5: 'a, T6: 'a, T7: 'a, T8: 'a, T9: 'a,

§

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)
where &'a T0: IntoPyObject<'py>, &'a T1: IntoPyObject<'py>, &'a T2: IntoPyObject<'py>, &'a T3: IntoPyObject<'py>, &'a T4: IntoPyObject<'py>, &'a T5: IntoPyObject<'py>, &'a T6: IntoPyObject<'py>, &'a T7: IntoPyObject<'py>, &'a T8: IntoPyObject<'py>, &'a T9: IntoPyObject<'py>, &'a T10: IntoPyObject<'py>, T0: 'a, T1: 'a, T2: 'a, T3: 'a, T4: 'a, T5: 'a, T6: 'a, T7: 'a, T8: 'a, T9: 'a, T10: 'a,

§

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)
where &'a T0: IntoPyObject<'py>, &'a T1: IntoPyObject<'py>, &'a T2: IntoPyObject<'py>, &'a T3: IntoPyObject<'py>, &'a T4: IntoPyObject<'py>, &'a T5: IntoPyObject<'py>, &'a T6: IntoPyObject<'py>, &'a T7: IntoPyObject<'py>, &'a T8: IntoPyObject<'py>, &'a T9: IntoPyObject<'py>, &'a T10: IntoPyObject<'py>, &'a T11: IntoPyObject<'py>, T0: 'a, T1: 'a, T2: 'a, T3: 'a, T4: 'a, T5: 'a, T6: 'a, T7: 'a, T8: 'a, T9: 'a, T10: 'a, T11: 'a,

§

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

§

fn into_pyobject( self, py: Python<'py>, ) -> Result<<&'a [T] as IntoPyObject<'py>>::Output, <&'a [T] as IntoPyObject<'py>>::Error>

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

§

type Target = PyAny

§

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

§

type Error = PyErr

§

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

§

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

§

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

§

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

§

fn into_pyobject( self, py: Python<'py>, ) -> Result<<&&'a T as IntoPyObject<'py>>::Output, <&&'a T as IntoPyObject<'py>>::Error>

§

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

§

type Target = PyAny

§

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

§

type Error = PyErr

§

fn into_pyobject( self, py: Python<'py>, ) -> Result<<&'a [T; N] as IntoPyObject<'py>>::Output, <&'a [T; N] as IntoPyObject<'py>>::Error>

§

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

§

type Target = PyString

§

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

§

type Error = Infallible

§

fn into_pyobject( self, py: Python<'py>, ) -> Result<<&&str as IntoPyObject<'py>>::Output, <&&str as IntoPyObject<'py>>::Error>

§

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

§

type Target = PyBool

§

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

§

type Error = Infallible

§

fn into_pyobject( self, py: Python<'py>, ) -> Result<<&bool as IntoPyObject<'py>>::Output, <&bool as IntoPyObject<'py>>::Error>

§

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

§

type Target = PyString

§

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

§

type Error = Infallible

§

fn into_pyobject( self, py: Python<'py>, ) -> Result<<&char as IntoPyObject<'py>>::Output, <&char as IntoPyObject<'py>>::Error>

§

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

§

type Target = PyFloat

§

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

§

type Error = Infallible

§

fn into_pyobject( self, py: Python<'py>, ) -> Result<<&f32 as IntoPyObject<'py>>::Output, <&f32 as IntoPyObject<'py>>::Error>

§

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

§

type Target = PyFloat

§

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

§

type Error = Infallible

§

fn into_pyobject( self, py: Python<'py>, ) -> Result<<&f64 as IntoPyObject<'py>>::Output, <&f64 as IntoPyObject<'py>>::Error>

§

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

§

type Target = PyInt

§

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

§

type Error = Infallible

§

fn into_pyobject( self, py: Python<'py>, ) -> Result<<&i8 as IntoPyObject<'py>>::Output, <&i8 as IntoPyObject<'py>>::Error>

§

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

§

type Target = PyInt

§

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

§

type Error = Infallible

§

fn into_pyobject( self, py: Python<'py>, ) -> Result<<&i16 as IntoPyObject<'py>>::Output, <&i16 as IntoPyObject<'py>>::Error>

§

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

§

type Target = PyInt

§

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

§

type Error = Infallible

§

fn into_pyobject( self, py: Python<'py>, ) -> Result<<&i32 as IntoPyObject<'py>>::Output, <&i32 as IntoPyObject<'py>>::Error>

§

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

§

type Target = PyInt

§

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

§

type Error = Infallible

§

fn into_pyobject( self, py: Python<'py>, ) -> Result<<&i64 as IntoPyObject<'py>>::Output, <&i64 as IntoPyObject<'py>>::Error>

§

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

§

type Target = PyInt

§

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

§

type Error = Infallible

§

fn into_pyobject( self, py: Python<'py>, ) -> Result<<&i128 as IntoPyObject<'py>>::Output, <&i128 as IntoPyObject<'py>>::Error>

§

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

§

type Target = PyInt

§

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

§

type Error = Infallible

§

fn into_pyobject( self, py: Python<'py>, ) -> Result<<&isize as IntoPyObject<'py>>::Output, <&isize as IntoPyObject<'py>>::Error>

§

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

§

type Target = PyString

§

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

§

type Error = Infallible

§

fn into_pyobject( self, py: Python<'py>, ) -> Result<<&str as IntoPyObject<'py>>::Output, <&str as IntoPyObject<'py>>::Error>

§

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

§

type Target = PyInt

§

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

§

type Error = Infallible

§

fn into_pyobject( self, py: Python<'py>, ) -> Result<<&u8 as IntoPyObject<'py>>::Output, <&u8 as IntoPyObject<'py>>::Error>

§

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

§

type Target = PyInt

§

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

§

type Error = Infallible

§

fn into_pyobject( self, py: Python<'py>, ) -> Result<<&u16 as IntoPyObject<'py>>::Output, <&u16 as IntoPyObject<'py>>::Error>

§

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

§

type Target = PyInt

§

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

§

type Error = Infallible

§

fn into_pyobject( self, py: Python<'py>, ) -> Result<<&u32 as IntoPyObject<'py>>::Output, <&u32 as IntoPyObject<'py>>::Error>

§

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

§

type Target = PyInt

§

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

§

type Error = Infallible

§

fn into_pyobject( self, py: Python<'py>, ) -> Result<<&u64 as IntoPyObject<'py>>::Output, <&u64 as IntoPyObject<'py>>::Error>

§

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

§

type Target = PyInt

§

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

§

type Error = Infallible

§

fn into_pyobject( self, py: Python<'py>, ) -> Result<<&u128 as IntoPyObject<'py>>::Output, <&u128 as IntoPyObject<'py>>::Error>

§

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

§

type Target = PyInt

§

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

§

type Error = Infallible

§

fn into_pyobject( self, py: Python<'py>, ) -> Result<<&usize as IntoPyObject<'py>>::Output, <&usize as IntoPyObject<'py>>::Error>

§

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

§

type Target = PyBool

§

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

§

type Error = Infallible

§

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

§

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

§

type Target = PyString

§

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

§

type Error = Infallible

§

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

§

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

§

type Target = PyFloat

§

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

§

type Error = Infallible

§

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

§

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

§

type Target = PyFloat

§

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

§

type Error = Infallible

§

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

§

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

§

type Target = PyInt

§

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

§

type Error = Infallible

§

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

§

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

§

type Target = PyInt

§

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

§

type Error = Infallible

§

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

§

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

§

type Target = PyInt

§

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

§

type Error = Infallible

§

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

§

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

§

type Target = PyInt

§

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

§

type Error = Infallible

§

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

§

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

§

type Target = PyInt

§

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

§

type Error = Infallible

§

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

§

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

§

type Target = PyInt

§

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

§

type Error = Infallible

§

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

§

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

§

type Target = PyInt

§

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

§

type Error = Infallible

§

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

§

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

§

type Target = PyInt

§

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

§

type Error = Infallible

§

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

§

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

§

type Target = PyInt

§

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

§

type Error = Infallible

§

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

§

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

§

type Target = PyInt

§

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

§

type Error = Infallible

§

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

§

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

§

type Target = PyInt

§

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

§

type Error = Infallible

§

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

§

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

§

type Target = PyTuple

§

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

§

type Error = Infallible

§

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

§

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

§

type Target = PyInt

§

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

§

type Error = Infallible

§

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

§

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

§

type Target = PyTuple

§

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

§

type Error = PyErr

§

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

§

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

§

type Target = PyTuple

§

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

§

type Error = PyErr

§

fn into_pyobject( self, py: Python<'py>, ) -> Result<<(T0, T1) as IntoPyObject<'py>>::Output, <(T0, T1) as IntoPyObject<'py>>::Error>

§

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

§

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>,

§

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>,

§

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>,

§

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>,

§

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>,

§

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>,

§

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>,

§

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>,

§

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>,

§

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

§

fn into_pyobject( self, py: Python<'py>, ) -> Result<<[T; N] as IntoPyObject<'py>>::Output, <[T; N] as IntoPyObject<'py>>::Error>

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

§

type Target = PyAny

§

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

§

type Error = PyErr

Implementors§

§

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

§

type Target = PySet

§

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

§

type Error = PyErr

§

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

§

type Target = PySet

§

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

§

type Error = PyErr

§

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

§

type Target = PySet

§

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

§

type Error = PyErr

§

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

§

type Target = PyDict

§

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

§

type Error = PyErr

§

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

§

type Target = PyDict

§

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

§

type Error = PyErr

§

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

§

type Target = PyDict

§

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

§

type Error = PyErr

§

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

§

type Target = PyAny

§

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

§

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

§

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

§

type Target = PyAny

§

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

§

type Error = PyErr

§

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

§

type Target = T

§

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

§

type Error = Infallible

§

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

§

type Target = T

§

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

§

type Error = Infallible

§

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

§

type Target = T

§

type Output = Borrowed<'a, 'py, T>

§

type Error = Infallible

§

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

§

type Target = T

§

type Output = Borrowed<'a, 'py, T>

§

type Error = Infallible

§

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

§

type Target = T

§

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

§

type Error = Infallible

§

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

§

type Target = T

§

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

§

type Error = Infallible

§

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

§

type Target = PyString

§

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

§

type Error = Infallible

§

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

§

type Target = PyString

§

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

§

type Error = Infallible

§

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

§

type Target = PyAny

§

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

§

type Error = PyErr

§

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

§

type Target = PyString

§

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

§

type Error = Infallible

§

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

§

type Target = PyString

§

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

§

type Error = Infallible

§

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

§

type Target = PyString

§

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

§

type Error = Infallible

§

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

§

type Target = PyAny

§

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

§

type Error = PyErr

§

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

§

type Target = PyAny

§

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

§

type Error = PyErr

§

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

§

type Target = PyInt

§

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

§

type Error = Infallible

§

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

§

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

§

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

§

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

§

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

§

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

§

type Target = PyInt

§

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

§

type Error = Infallible

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

type Target = PyDelta

§

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

§

type Error = PyErr

§

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

§

type Target = PyAny

§

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

§

type Error = PyErr

§

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

§

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

§

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

§

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

§

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

§

type Target = PyAny

§

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

§

type Error = PyErr

§

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

§

type Target = PyString

§

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

§

type Error = Infallible

§

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

§

type Target = PyString

§

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

§

type Error = Infallible

§

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

§

type Target = PyString

§

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

§

type Error = Infallible

§

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

§

type Target = PyAny

§

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

§

type Error = PyErr

§

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

§

type Target = PyAny

§

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

§

type Error = PyErr

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

type Target = PyDelta

§

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

§

type Error = PyErr

§

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

§

type Target = PyAny

§

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

§

type Error = PyErr

§

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

§

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

§

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

§

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

§

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

§

type Target = PySet

§

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

§

type Error = PyErr

§

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

§

type Target = PySet

§

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

§

type Error = PyErr

§

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

§

type Target = PySet

§

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

§

type Error = PyErr

§

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

§

type Target = PyDict

§

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

§

type Error = PyErr

§

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

§

type Target = PyDict

§

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

§

type Error = PyErr

§

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

§

type Target = PyDict

§

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

§

type Error = PyErr

§

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

§

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

§

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

§

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

§

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

§

type Target = PyAny

§

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

§

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

§

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

§

type Target = PyAny

§

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

§

type Error = PyErr

§

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

§

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

§

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

§

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

§

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

§

type Target = PyAny

§

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

§

type Error = PyErr

§

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

§

type Target = T

§

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

§

type Error = Infallible

§

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

§

type Target = T

§

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

§

type Error = Infallible

§

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

§

type Target = T

§

type Output = Bound<'py, T>

§

type Error = Infallible

§

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

§

type Target = T

§

type Output = Bound<'py, T>

§

type Error = Infallible