Skip to main content

IntoPyObject

Trait IntoPyObject 

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

    const OUTPUT_TYPE: PyStaticExpr = _;

    // 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.

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 Python<'py> 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.

Provided Associated Constants§

Source

const OUTPUT_TYPE: PyStaticExpr = _

Extracts the type hint information for this type when it appears as a return value.

For example, Vec<u32> would return List[int]. The default implementation returns Any, which is correct for any type.

For most types, the return value for this method will be identical to that of FromPyObject::INPUT_TYPE. It may be different for some types, such as Dict, to allow duck-typing: functions return Dict but take Mapping as 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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

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

Source§

const OUTPUT_TYPE: PyStaticExpr = <&[A::Item]>::OUTPUT_TYPE

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, K: 'a,

Source§

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

Source§

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

Source§

const OUTPUT_TYPE: PyStaticExpr

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>, K: 'a, V: 'a,

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§

const OUTPUT_TYPE: PyStaticExpr

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§

const OUTPUT_TYPE: PyStaticExpr

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§

const OUTPUT_TYPE: PyStaticExpr

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§

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

Source§

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

Source§

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

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§

const OUTPUT_TYPE: PyStaticExpr = Option<&T>::OUTPUT_TYPE

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§

const OUTPUT_TYPE: PyStaticExpr = <&T>::SEQUENCE_OUTPUT_TYPE

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§

const OUTPUT_TYPE: PyStaticExpr = <&[T]>::OUTPUT_TYPE

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> IntoPyObject<'py> for &&'a T
where &'a T: IntoPyObject<'py>,

Source§

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

Source§

const OUTPUT_TYPE: PyStaticExpr = <&[T]>::OUTPUT_TYPE

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§

const OUTPUT_TYPE: PyStaticExpr = String::OUTPUT_TYPE

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§

const OUTPUT_TYPE: PyStaticExpr = <&OsStr>::OUTPUT_TYPE

Source§

type Target = PyString

Source§

type Output = Bound<'py, <&&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 &&Path

Source§

const OUTPUT_TYPE: PyStaticExpr = <&Path>::OUTPUT_TYPE

Source§

type Target = PyAny

Source§

type Output = Bound<'py, <&&Path 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§

const OUTPUT_TYPE: PyStaticExpr = String::OUTPUT_TYPE

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<'_, CStr>

Source§

const OUTPUT_TYPE: PyStaticExpr = <&CStr>::OUTPUT_TYPE

Source§

type Target = PyString

Source§

type Output = Bound<'py, <&Cow<'_, CStr> 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<'_, OsStr>

Source§

const OUTPUT_TYPE: PyStaticExpr = <&OsStr>::OUTPUT_TYPE

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§

const OUTPUT_TYPE: PyStaticExpr = <&Path>::OUTPUT_TYPE

Source§

type Target = PyAny

Source§

type Output = Bound<'py, <&Cow<'_, Path> 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 &IpAddr

Source§

const OUTPUT_TYPE: PyStaticExpr = IpAddr::OUTPUT_TYPE

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§

const OUTPUT_TYPE: PyStaticExpr = bool::OUTPUT_TYPE

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§

const OUTPUT_TYPE: PyStaticExpr = String::OUTPUT_TYPE

Source§

type Target = PyString

Source§

type Output = Bound<'py, <&char 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 &f32

Source§

const OUTPUT_TYPE: PyStaticExpr = f32::OUTPUT_TYPE

Source§

type Target = PyFloat

Source§

type Output = Bound<'py, <&f32 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 &f64

Source§

const OUTPUT_TYPE: PyStaticExpr = f64::OUTPUT_TYPE

Source§

type Target = PyFloat

Source§

type Output = Bound<'py, <&f64 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 &i8

Source§

const OUTPUT_TYPE: PyStaticExpr = i8::OUTPUT_TYPE

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§

const OUTPUT_TYPE: PyStaticExpr = i16::OUTPUT_TYPE

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§

const OUTPUT_TYPE: PyStaticExpr = i32::OUTPUT_TYPE

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§

const OUTPUT_TYPE: PyStaticExpr = i64::OUTPUT_TYPE

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§

const OUTPUT_TYPE: PyStaticExpr = i128::OUTPUT_TYPE

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§

const OUTPUT_TYPE: PyStaticExpr = isize::OUTPUT_TYPE

Source§

type Target = PyInt

Source§

type Output = Bound<'py, <&isize 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 &str

Source§

const OUTPUT_TYPE: PyStaticExpr = String::OUTPUT_TYPE

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 &u8

Source§

const OUTPUT_TYPE: PyStaticExpr = u8::OUTPUT_TYPE

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§

const OUTPUT_TYPE: PyStaticExpr = u16::OUTPUT_TYPE

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§

const OUTPUT_TYPE: PyStaticExpr = u32::OUTPUT_TYPE

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§

const OUTPUT_TYPE: PyStaticExpr = u64::OUTPUT_TYPE

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§

const OUTPUT_TYPE: PyStaticExpr = u128::OUTPUT_TYPE

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§

const OUTPUT_TYPE: PyStaticExpr = u64::OUTPUT_TYPE

Source§

type Target = PyInt

Source§

type Output = Bound<'py, <&usize 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 &CString

Source§

const OUTPUT_TYPE: PyStaticExpr = <&CStr>::OUTPUT_TYPE

Source§

type Target = PyString

Source§

type Output = Bound<'py, <&CString 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 &String

Source§

const OUTPUT_TYPE: PyStaticExpr = String::OUTPUT_TYPE

Source§

type Target = PyString

Source§

type Output = Bound<'py, <&String 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 &CStr

Source§

const OUTPUT_TYPE: PyStaticExpr = <&str>::OUTPUT_TYPE

Source§

type Target = PyString

Source§

type Output = Bound<'py, <&CStr 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 &Ipv4Addr

Source§

const OUTPUT_TYPE: PyStaticExpr = Ipv4Addr::OUTPUT_TYPE

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§

const OUTPUT_TYPE: PyStaticExpr = Ipv6Addr::OUTPUT_TYPE

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§

const OUTPUT_TYPE: PyStaticExpr = Duration::OUTPUT_TYPE

Source§

type Target = PyDelta

Source§

type Output = Bound<'py, <&Duration 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 &OsStr

Source§

const OUTPUT_TYPE: PyStaticExpr = PyString::TYPE_HINT

Source§

type Target = PyString

Source§

type Output = Bound<'py, <&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 &OsString

Source§

const OUTPUT_TYPE: PyStaticExpr = <&OsStr>::OUTPUT_TYPE

Source§

type Target = PyString

Source§

type Output = Bound<'py, <&OsString 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 &Path

Source§

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

Source§

const OUTPUT_TYPE: PyStaticExpr = <&Path>::OUTPUT_TYPE

Source§

type Target = PyAny

Source§

type Output = Bound<'py, <&PathBuf 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 &SystemTime

Source§

const OUTPUT_TYPE: PyStaticExpr = SystemTime::OUTPUT_TYPE

Source§

type Target = PyDateTime

Source§

type Output = Bound<'py, <&SystemTime 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 &NaiveDate

Source§

const OUTPUT_TYPE: PyStaticExpr = NaiveDate::OUTPUT_TYPE

Source§

type Target = PyDate

Source§

type Output = Bound<'py, <&NaiveDate 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 &NaiveDateTime

Source§

const OUTPUT_TYPE: PyStaticExpr = NaiveDateTime::OUTPUT_TYPE

Source§

type Target = PyDateTime

Source§

type Output = Bound<'py, <&NaiveDateTime 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 &NaiveTime

Source§

const OUTPUT_TYPE: PyStaticExpr = NaiveTime::OUTPUT_TYPE

Source§

type Target = PyTime

Source§

type Output = Bound<'py, <&NaiveTime 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 &FixedOffset

Source§

const OUTPUT_TYPE: PyStaticExpr = FixedOffset::OUTPUT_TYPE

Source§

type Target = PyTzInfo

Source§

type Output = Bound<'py, <&FixedOffset 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 &Local

Available on crate feature chrono-local only.
Source§

const OUTPUT_TYPE: PyStaticExpr = Local::OUTPUT_TYPE

Source§

type Target = PyTzInfo

Source§

type Output = Borrowed<'static, 'py, <&Local 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 &Utc

Source§

const OUTPUT_TYPE: PyStaticExpr = Utc::OUTPUT_TYPE

Source§

type Target = PyTzInfo

Source§

type Output = Borrowed<'static, '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§

const OUTPUT_TYPE: PyStaticExpr = PyInt::TYPE_HINT

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§

const OUTPUT_TYPE: PyStaticExpr = PyInt::TYPE_HINT

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§

const OUTPUT_TYPE: PyStaticExpr = Complex<f32>::OUTPUT_TYPE

Source§

type Target = PyComplex

Source§

type Output = Bound<'py, <&Complex<f32> 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 &Complex<f64>

Source§

const OUTPUT_TYPE: PyStaticExpr = Complex<f64>::OUTPUT_TYPE

Source§

type Target = PyComplex

Source§

type Output = Bound<'py, <&Complex<f64> 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 &Ratio<i8>

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

const OUTPUT_TYPE: PyStaticExpr = NonNilUuid::OUTPUT_TYPE

Source§

type Target = PyAny

Source§

type Output = Bound<'py, <&NonNilUuid 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 &Uuid

Source§

const OUTPUT_TYPE: PyStaticExpr = Uuid::OUTPUT_TYPE

Source§

type Target = PyAny

Source§

type Output = Bound<'py, <&Uuid 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§

const OUTPUT_TYPE: PyStaticExpr = NonZeroI8::OUTPUT_TYPE

Source§

type Target = PyInt

Source§

type Output = Bound<'py, <&NonZero<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 &NonZeroI16

Source§

const OUTPUT_TYPE: PyStaticExpr = NonZeroI16::OUTPUT_TYPE

Source§

type Target = PyInt

Source§

type Output = Bound<'py, <&NonZero<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 &NonZeroI32

Source§

const OUTPUT_TYPE: PyStaticExpr = NonZeroI32::OUTPUT_TYPE

Source§

type Target = PyInt

Source§

type Output = Bound<'py, <&NonZero<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 &NonZeroI64

Source§

const OUTPUT_TYPE: PyStaticExpr = NonZeroI64::OUTPUT_TYPE

Source§

type Target = PyInt

Source§

type Output = Bound<'py, <&NonZero<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 &NonZeroI128

Source§

const OUTPUT_TYPE: PyStaticExpr = NonZeroI128::OUTPUT_TYPE

Source§

type Target = PyInt

Source§

type Output = Bound<'py, <&NonZero<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 &NonZeroIsize

Source§

const OUTPUT_TYPE: PyStaticExpr = NonZeroIsize::OUTPUT_TYPE

Source§

type Target = PyInt

Source§

type Output = Bound<'py, <&NonZero<isize> 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 &NonZeroU8

Source§

const OUTPUT_TYPE: PyStaticExpr = NonZeroU8::OUTPUT_TYPE

Source§

type Target = PyInt

Source§

type Output = Bound<'py, <&NonZero<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 &NonZeroU16

Source§

const OUTPUT_TYPE: PyStaticExpr = NonZeroU16::OUTPUT_TYPE

Source§

type Target = PyInt

Source§

type Output = Bound<'py, <&NonZero<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 &NonZeroU32

Source§

const OUTPUT_TYPE: PyStaticExpr = NonZeroU32::OUTPUT_TYPE

Source§

type Target = PyInt

Source§

type Output = Bound<'py, <&NonZero<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 &NonZeroU64

Source§

const OUTPUT_TYPE: PyStaticExpr = NonZeroU64::OUTPUT_TYPE

Source§

type Target = PyInt

Source§

type Output = Bound<'py, <&NonZero<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 &NonZeroU128

Source§

const OUTPUT_TYPE: PyStaticExpr = NonZeroU128::OUTPUT_TYPE

Source§

type Target = PyInt

Source§

type Output = Bound<'py, <&NonZero<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 &NonZeroUsize

Source§

const OUTPUT_TYPE: PyStaticExpr = NonZeroUsize::OUTPUT_TYPE

Source§

type Target = PyInt

Source§

type Output = Bound<'py, <&NonZero<usize> 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 &Duration

Source§

const OUTPUT_TYPE: PyStaticExpr = Duration::OUTPUT_TYPE

Source§

type Target = PyDelta

Source§

type Output = Bound<'py, <&TimeDelta 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 &Bytes

Source§

const OUTPUT_TYPE: PyStaticExpr = PyBytes::TYPE_HINT

Source§

type Target = PyBytes

Source§

type Output = Bound<'py, <&Bytes 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 &Date

Source§

const OUTPUT_TYPE: PyStaticExpr = Date::OUTPUT_TYPE

Source§

type Target = PyDate

Source§

type Output = Bound<'py, <&Date 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 &Date

Source§

const OUTPUT_TYPE: PyStaticExpr = Date::OUTPUT_TYPE

Source§

type Target = PyDate

Source§

type Output = Bound<'py, <&Date 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 &DateTime

Source§

const OUTPUT_TYPE: PyStaticExpr = DateTime::OUTPUT_TYPE

Source§

type Target = PyDateTime

Source§

type Output = Bound<'py, <&DateTime 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 &Decimal

Source§

const OUTPUT_TYPE: PyStaticExpr = Decimal::OUTPUT_TYPE

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 &Duration

Source§

const OUTPUT_TYPE: PyStaticExpr = Duration::OUTPUT_TYPE

Source§

type Target = PyDelta

Source§

type Output = Bound<'py, <&Duration 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 &ISOWeekDate

Source§

const OUTPUT_TYPE: PyStaticExpr = ISOWeekDate::OUTPUT_TYPE

Source§

type Target = PyDate

Source§

type Output = Bound<'py, <&ISOWeekDate 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 &NotNan<f32>

Source§

const OUTPUT_TYPE: PyStaticExpr = NotNan<f32>::OUTPUT_TYPE

Source§

type Target = PyFloat

Source§

type Output = Bound<'py, <&NotNan<f32> 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 &NotNan<f64>

Source§

const OUTPUT_TYPE: PyStaticExpr = NotNan<f64>::OUTPUT_TYPE

Source§

type Target = PyFloat

Source§

type Output = Bound<'py, <&NotNan<f64> 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 &Offset

Source§

const OUTPUT_TYPE: PyStaticExpr = Offset::OUTPUT_TYPE

Source§

type Target = PyTzInfo

Source§

type Output = Bound<'py, <&Offset 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 &OffsetDateTime

Source§

const OUTPUT_TYPE: PyStaticExpr = OffsetDateTime::OUTPUT_TYPE

Source§

type Target = PyDateTime

Source§

type Output = Bound<'py, <&OffsetDateTime 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 &OrderedFloat<f32>

Source§

const OUTPUT_TYPE: PyStaticExpr = OrderedFloat<f32>::OUTPUT_TYPE

Source§

type Target = PyFloat

Source§

type Output = Bound<'py, <&OrderedFloat<f32> 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 &OrderedFloat<f64>

Source§

const OUTPUT_TYPE: PyStaticExpr = OrderedFloat<f64>::OUTPUT_TYPE

Source§

type Target = PyFloat

Source§

type Output = Bound<'py, <&OrderedFloat<f64> 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 &PrimitiveDateTime

Source§

const OUTPUT_TYPE: PyStaticExpr = PrimitiveDateTime::OUTPUT_TYPE

Source§

type Target = PyDateTime

Source§

type Output = Bound<'py, <&PrimitiveDateTime 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 &SignedDuration

Source§

const OUTPUT_TYPE: PyStaticExpr = SignedDuration::OUTPUT_TYPE

Source§

type Target = PyDelta

Source§

type Output = Bound<'py, <&SignedDuration 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 &Time

Source§

const OUTPUT_TYPE: PyStaticExpr = Time::OUTPUT_TYPE

Source§

type Target = PyTime

Source§

type Output = Bound<'py, <&Time 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 &Time

Source§

const OUTPUT_TYPE: PyStaticExpr = Time::OUTPUT_TYPE

Source§

type Target = PyTime

Source§

type Output = Bound<'py, <&Time 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 &TimeZone

Source§

const OUTPUT_TYPE: PyStaticExpr = PyTzInfo::TYPE_HINT

Source§

type Target = PyTzInfo

Source§

type Output = Bound<'py, <&TimeZone 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 &Timestamp

Source§

const OUTPUT_TYPE: PyStaticExpr = Timestamp::OUTPUT_TYPE

Source§

type Target = PyDateTime

Source§

type Output = Bound<'py, <&Timestamp 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 &Tz

Source§

const OUTPUT_TYPE: PyStaticExpr = Tz::OUTPUT_TYPE

Source§

type Target = PyTzInfo

Source§

type Output = Bound<'py, <&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> IntoPyObject<'py> for &UtcDateTime

Source§

const OUTPUT_TYPE: PyStaticExpr = UtcDateTime::OUTPUT_TYPE

Source§

type Target = PyDateTime

Source§

type Output = Bound<'py, <&UtcDateTime 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 &UtcOffset

Source§

const OUTPUT_TYPE: PyStaticExpr = UtcOffset::OUTPUT_TYPE

Source§

type Target = PyTzInfo

Source§

type Output = Bound<'py, <&UtcOffset 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 &Zoned

Source§

const OUTPUT_TYPE: PyStaticExpr = PyDateTime::TYPE_HINT

Source§

type Target = PyDateTime

Source§

type Output = Bound<'py, <&Zoned 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§

const OUTPUT_TYPE: PyStaticExpr = String::OUTPUT_TYPE

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<'_, CStr>

Source§

const OUTPUT_TYPE: PyStaticExpr = <&CStr>::OUTPUT_TYPE

Source§

type Target = PyString

Source§

type Output = Bound<'py, <Cow<'_, CStr> 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<'_, OsStr>

Source§

const OUTPUT_TYPE: PyStaticExpr = <&OsStr>::OUTPUT_TYPE

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§

const OUTPUT_TYPE: PyStaticExpr = <&Path>::OUTPUT_TYPE

Source§

type Target = PyAny

Source§

type Output = Bound<'py, <Cow<'_, Path> 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 IpAddr

Source§

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

Source§

const OUTPUT_TYPE: PyStaticExpr = PyBool::TYPE_HINT

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§

const OUTPUT_TYPE: PyStaticExpr = String::OUTPUT_TYPE

Source§

type Target = PyString

Source§

type Output = Bound<'py, <char 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 f32

Source§

const OUTPUT_TYPE: PyStaticExpr = PyFloat::TYPE_HINT

Source§

type Target = PyFloat

Source§

type Output = Bound<'py, <f32 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 f64

Source§

const OUTPUT_TYPE: PyStaticExpr = PyFloat::TYPE_HINT

Source§

type Target = PyFloat

Source§

type Output = Bound<'py, <f64 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 i8

Source§

const OUTPUT_TYPE: PyStaticExpr = PyInt::TYPE_HINT

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§

const OUTPUT_TYPE: PyStaticExpr = PyInt::TYPE_HINT

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§

const OUTPUT_TYPE: PyStaticExpr = PyInt::TYPE_HINT

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§

const OUTPUT_TYPE: PyStaticExpr = PyInt::TYPE_HINT

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§

const OUTPUT_TYPE: PyStaticExpr = PyInt::TYPE_HINT

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§

const OUTPUT_TYPE: PyStaticExpr = PyInt::TYPE_HINT

Source§

type Target = PyInt

Source§

type Output = Bound<'py, <isize 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 u8

Source§

const OUTPUT_TYPE: PyStaticExpr = PyInt::TYPE_HINT

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§

const OUTPUT_TYPE: PyStaticExpr = PyInt::TYPE_HINT

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§

const OUTPUT_TYPE: PyStaticExpr = PyInt::TYPE_HINT

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§

const OUTPUT_TYPE: PyStaticExpr = PyInt::TYPE_HINT

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§

const OUTPUT_TYPE: PyStaticExpr = PyInt::TYPE_HINT

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 ()

Source§

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

Source§

const OUTPUT_TYPE: PyStaticExpr = u64::OUTPUT_TYPE

Source§

type Target = PyInt

Source§

type Output = Bound<'py, <usize 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 CString

Source§

const OUTPUT_TYPE: PyStaticExpr = <&CStr>::OUTPUT_TYPE

Source§

type Target = PyString

Source§

type Output = Bound<'py, <CString 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 String

Source§

const OUTPUT_TYPE: PyStaticExpr = PyString::TYPE_HINT

Source§

type Target = PyString

Source§

type Output = Bound<'py, <String 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 Ipv4Addr

Source§

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

Source§

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

Source§

const OUTPUT_TYPE: PyStaticExpr = PyDelta::TYPE_HINT

Source§

type Target = PyDelta

Source§

type Output = Bound<'py, <Duration 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 OsString

Source§

const OUTPUT_TYPE: PyStaticExpr = <&OsStr>::OUTPUT_TYPE

Source§

type Target = PyString

Source§

type Output = Bound<'py, <OsString 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 PathBuf

Source§

const OUTPUT_TYPE: PyStaticExpr = <&Path>::OUTPUT_TYPE

Source§

type Target = PyAny

Source§

type Output = Bound<'py, <PathBuf 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 SystemTime

Source§

const OUTPUT_TYPE: PyStaticExpr = PyDateTime::TYPE_HINT

Source§

type Target = PyDateTime

Source§

type Output = Bound<'py, <SystemTime 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 NaiveDate

Source§

const OUTPUT_TYPE: PyStaticExpr = PyDate::TYPE_HINT

Source§

type Target = PyDate

Source§

type Output = Bound<'py, <NaiveDate 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 NaiveDateTime

Source§

const OUTPUT_TYPE: PyStaticExpr = PyDateTime::TYPE_HINT

Source§

type Target = PyDateTime

Source§

type Output = Bound<'py, <NaiveDateTime 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 NaiveTime

Source§

const OUTPUT_TYPE: PyStaticExpr = PyTime::TYPE_HINT

Source§

type Target = PyTime

Source§

type Output = Bound<'py, <NaiveTime 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 FixedOffset

Source§

impl<'py> IntoPyObject<'py> for Local

Available on crate feature chrono-local only.
Source§

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

Source§

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

Source§

const OUTPUT_TYPE: PyStaticExpr = <&BigInt>::OUTPUT_TYPE

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§

const OUTPUT_TYPE: PyStaticExpr = <&BigUint>::OUTPUT_TYPE

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§

const OUTPUT_TYPE: PyStaticExpr = <&Ratio<i8>>::OUTPUT_TYPE

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§

const OUTPUT_TYPE: PyStaticExpr = <&Ratio<i16>>::OUTPUT_TYPE

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§

const OUTPUT_TYPE: PyStaticExpr = <&Ratio<i32>>::OUTPUT_TYPE

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§

const OUTPUT_TYPE: PyStaticExpr = <&Ratio<i64>>::OUTPUT_TYPE

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§

const OUTPUT_TYPE: PyStaticExpr = <&Ratio<isize>>::OUTPUT_TYPE

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§

const OUTPUT_TYPE: PyStaticExpr = <&Ratio<BigInt>>::OUTPUT_TYPE

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 NonNilUuid

Source§

const OUTPUT_TYPE: PyStaticExpr = Uuid::OUTPUT_TYPE

Source§

type Target = PyAny

Source§

type Output = Bound<'py, <NonNilUuid 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 Uuid

Source§

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

Source§

const OUTPUT_TYPE: PyStaticExpr = PyInt::TYPE_HINT

Source§

type Target = PyInt

Source§

type Output = Bound<'py, <NonZero<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 NonZeroI16

Source§

const OUTPUT_TYPE: PyStaticExpr = PyInt::TYPE_HINT

Source§

type Target = PyInt

Source§

type Output = Bound<'py, <NonZero<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 NonZeroI32

Source§

const OUTPUT_TYPE: PyStaticExpr = PyInt::TYPE_HINT

Source§

type Target = PyInt

Source§

type Output = Bound<'py, <NonZero<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 NonZeroI64

Source§

const OUTPUT_TYPE: PyStaticExpr = PyInt::TYPE_HINT

Source§

type Target = PyInt

Source§

type Output = Bound<'py, <NonZero<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 NonZeroI128

Source§

const OUTPUT_TYPE: PyStaticExpr = PyInt::TYPE_HINT

Source§

type Target = PyInt

Source§

type Output = Bound<'py, <NonZero<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 NonZeroIsize

Source§

const OUTPUT_TYPE: PyStaticExpr = PyInt::TYPE_HINT

Source§

type Target = PyInt

Source§

type Output = Bound<'py, <NonZero<isize> 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 NonZeroU8

Source§

const OUTPUT_TYPE: PyStaticExpr = PyInt::TYPE_HINT

Source§

type Target = PyInt

Source§

type Output = Bound<'py, <NonZero<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 NonZeroU16

Source§

const OUTPUT_TYPE: PyStaticExpr = PyInt::TYPE_HINT

Source§

type Target = PyInt

Source§

type Output = Bound<'py, <NonZero<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 NonZeroU32

Source§

const OUTPUT_TYPE: PyStaticExpr = PyInt::TYPE_HINT

Source§

type Target = PyInt

Source§

type Output = Bound<'py, <NonZero<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 NonZeroU64

Source§

const OUTPUT_TYPE: PyStaticExpr = PyInt::TYPE_HINT

Source§

type Target = PyInt

Source§

type Output = Bound<'py, <NonZero<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 NonZeroU128

Source§

const OUTPUT_TYPE: PyStaticExpr = PyInt::TYPE_HINT

Source§

type Target = PyInt

Source§

type Output = Bound<'py, <NonZero<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 NonZeroUsize

Source§

const OUTPUT_TYPE: PyStaticExpr = PyInt::TYPE_HINT

Source§

type Target = PyInt

Source§

type Output = Bound<'py, <NonZero<usize> 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 Duration

Source§

const OUTPUT_TYPE: PyStaticExpr = PyDelta::TYPE_HINT

Source§

type Target = PyDelta

Source§

type Output = Bound<'py, <TimeDelta 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 BigDecimal

Source§

const OUTPUT_TYPE: PyStaticExpr

Source§

type Target = PyAny

Source§

type Output = Bound<'py, <BigDecimal 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 Bytes

Source§

const OUTPUT_TYPE: PyStaticExpr = PyBytes::TYPE_HINT

Source§

type Target = PyBytes

Source§

type Output = Bound<'py, <Bytes 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 Date

Source§

const OUTPUT_TYPE: PyStaticExpr = PyDate::TYPE_HINT

Source§

type Target = PyDate

Source§

type Output = Bound<'py, <Date 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 Date

Source§

const OUTPUT_TYPE: PyStaticExpr = PyDate::TYPE_HINT

Source§

type Target = PyDate

Source§

type Output = Bound<'py, <Date 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 DateTime

Source§

const OUTPUT_TYPE: PyStaticExpr = PyDateTime::TYPE_HINT

Source§

type Target = PyDateTime

Source§

type Output = Bound<'py, <DateTime 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 Decimal

Source§

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

Source§

const OUTPUT_TYPE: PyStaticExpr = PyDelta::TYPE_HINT

Source§

type Target = PyDelta

Source§

type Output = Bound<'py, <Duration 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 ISOWeekDate

Source§

const OUTPUT_TYPE: PyStaticExpr = Date::OUTPUT_TYPE

Source§

type Target = PyDate

Source§

type Output = Bound<'py, <ISOWeekDate 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 NotNan<f32>

Source§

const OUTPUT_TYPE: PyStaticExpr = f32::OUTPUT_TYPE

Source§

type Target = PyFloat

Source§

type Output = Bound<'py, <NotNan<f32> 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 NotNan<f64>

Source§

const OUTPUT_TYPE: PyStaticExpr = f64::OUTPUT_TYPE

Source§

type Target = PyFloat

Source§

type Output = Bound<'py, <NotNan<f64> 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 Offset

Source§

impl<'py> IntoPyObject<'py> for OffsetDateTime

Source§

const OUTPUT_TYPE: PyStaticExpr = PyDateTime::TYPE_HINT

Source§

type Target = PyDateTime

Source§

type Output = Bound<'py, <OffsetDateTime 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 OrderedFloat<f32>

Source§

const OUTPUT_TYPE: PyStaticExpr = f32::OUTPUT_TYPE

Source§

type Target = PyFloat

Source§

type Output = Bound<'py, <OrderedFloat<f32> 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 OrderedFloat<f64>

Source§

const OUTPUT_TYPE: PyStaticExpr = f64::OUTPUT_TYPE

Source§

type Target = PyFloat

Source§

type Output = Bound<'py, <OrderedFloat<f64> 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 PrimitiveDateTime

Source§

const OUTPUT_TYPE: PyStaticExpr = PyDateTime::TYPE_HINT

Source§

type Target = PyDateTime

Source§

type Output = Bound<'py, <PrimitiveDateTime 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 SignedDuration

Source§

const OUTPUT_TYPE: PyStaticExpr = PyDelta::TYPE_HINT

Source§

type Target = PyDelta

Source§

type Output = Bound<'py, <SignedDuration 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 Time

Source§

const OUTPUT_TYPE: PyStaticExpr = PyTime::TYPE_HINT

Source§

type Target = PyTime

Source§

type Output = Bound<'py, <Time 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 Time

Source§

const OUTPUT_TYPE: PyStaticExpr = PyTime::TYPE_HINT

Source§

type Target = PyTime

Source§

type Output = Bound<'py, <Time 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 TimeZone

Source§

const OUTPUT_TYPE: PyStaticExpr = <&Self>::OUTPUT_TYPE

Source§

type Target = PyTzInfo

Source§

type Output = Bound<'py, <TimeZone 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 Timestamp

Source§

const OUTPUT_TYPE: PyStaticExpr = Zoned::OUTPUT_TYPE

Source§

type Target = PyDateTime

Source§

type Output = Bound<'py, <Timestamp 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 Tz

Source§

impl<'py> IntoPyObject<'py> for UtcDateTime

Source§

const OUTPUT_TYPE: PyStaticExpr = PyDateTime::TYPE_HINT

Source§

type Target = PyDateTime

Source§

type Output = Bound<'py, <UtcDateTime 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 UtcOffset

Source§

impl<'py> IntoPyObject<'py> for Zoned

Source§

const OUTPUT_TYPE: PyStaticExpr = <&Self>::OUTPUT_TYPE

Source§

type Target = PyDateTime

Source§

type Output = Bound<'py, <Zoned 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§

const OUTPUT_TYPE: PyStaticExpr = <A::Item>::SEQUENCE_OUTPUT_TYPE

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§

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

Source§

const OUTPUT_TYPE: PyStaticExpr

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§

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

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§

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

Source§

const OUTPUT_TYPE: PyStaticExpr

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§

const OUTPUT_TYPE: PyStaticExpr

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§

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

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§

const OUTPUT_TYPE: PyStaticExpr = <&T>::SEQUENCE_OUTPUT_TYPE

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§

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§

const OUTPUT_TYPE: PyStaticExpr = T::SEQUENCE_OUTPUT_TYPE

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§

const OUTPUT_TYPE: PyStaticExpr = T::SEQUENCE_OUTPUT_TYPE

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§

const OUTPUT_TYPE: PyStaticExpr = T::OUTPUT_TYPE

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§

const OUTPUT_TYPE: PyStaticExpr = T::OUTPUT_TYPE

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> IntoPyObject<'py> for &DateTime<Tz>
where Tz: IntoPyObject<'py> + TimeZone,

Source§

const OUTPUT_TYPE: PyStaticExpr = PyDateTime::TYPE_HINT

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> IntoPyObject<'py> for DateTime<Tz>
where Tz: IntoPyObject<'py> + TimeZone,

Source§

const OUTPUT_TYPE: PyStaticExpr = <&DateTime<Tz>>::OUTPUT_TYPE

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: PyClass> IntoPyObject<'py> for &'a PyRef<'py, T>

Source§

const OUTPUT_TYPE: PyStaticExpr = T::TYPE_HINT

Source§

type Target = T

Source§

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

Source§

type Error = Infallible

Source§

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

Source§

const OUTPUT_TYPE: PyStaticExpr = T::TYPE_HINT

Source§

type Target = T

Source§

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

Source§

type Error = Infallible

Source§

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

Source§

const OUTPUT_TYPE: PyStaticExpr = T::TYPE_HINT

Source§

type Target = T

Source§

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

Source§

type Error = Infallible

Source§

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

Source§

const OUTPUT_TYPE: PyStaticExpr = T::TYPE_HINT

Source§

type Target = T

Source§

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

Source§

type Error = Infallible

Source§

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

Source§

const OUTPUT_TYPE: PyStaticExpr = T::TYPE_HINT

Source§

type Target = T

Source§

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

Source§

type Error = Infallible

Source§

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

Source§

const OUTPUT_TYPE: PyStaticExpr = T::TYPE_HINT

Source§

type Target = T

Source§

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

Source§

type Error = Infallible

Source§

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

Source§

const OUTPUT_TYPE: PyStaticExpr = T::TYPE_HINT

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: PyTypeCheck> IntoPyObject<'py> for &'a Py<T>

Source§

const OUTPUT_TYPE: PyStaticExpr = T::TYPE_HINT

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: PyTypeCheck> IntoPyObject<'py> for &Borrowed<'a, 'py, T>

Source§

const OUTPUT_TYPE: PyStaticExpr = T::TYPE_HINT

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: PyTypeCheck> IntoPyObject<'py> for Borrowed<'a, 'py, T>

Source§

const OUTPUT_TYPE: PyStaticExpr = T::TYPE_HINT

Source§

type Target = T

Source§

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

Source§

type Error = Infallible

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

const OUTPUT_TYPE: PyStaticExpr = <Coroutine as crate::PyTypeInfo>::TYPE_HINT

Source§

type Target = Coroutine

Source§

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

Source§

type Error = PyErr

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

const OUTPUT_TYPE: PyStaticExpr = T::TYPE_HINT

Source§

type Target = T

Source§

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

Source§

type Error = Infallible

Source§

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