pub trait IntoPyObject<'py>: Sized {
type Target;
type Output: BoundObject<'py, Self::Target>;
type Error: Into<PyErr>;
const OUTPUT_TYPE: TypeHint = _;
// Required method
fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>;
// Provided method
fn type_output() -> TypeInfo { ... }
}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
Targetassociated type) - allows for the smart pointer containing the Python object to be either
Bound<'py, Self::Target>orBorrowed<'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
IntoPyObjectExttrait, which provides convenience methods for common usages ofIntoPyObjectwhich erase type information and convert errors toPyErr.
Provided Associated Constants§
Sourceconst OUTPUT_TYPE: TypeHint = _
const OUTPUT_TYPE: TypeHint = _
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§
Sourcetype Output: BoundObject<'py, Self::Target>
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.
Required Methods§
Provided Methods§
Sourcefn type_output() -> TypeInfo
fn type_output() -> TypeInfo
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::type_input.
It may be different for some types, such as Dict, to allow duck-typing: functions return Dict but take Mapping as argument.
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§
Source§impl<'a, 'py, A> IntoPyObject<'py> for &'a SmallVec<A>where
A: Array,
&'a A::Item: IntoPyObject<'py>,
impl<'a, 'py, A> IntoPyObject<'py> for &'a SmallVec<A>where
A: Array,
&'a A::Item: IntoPyObject<'py>,
Source§impl<'a, 'py, K> IntoPyObject<'py> for &'a BTreeSet<K>
impl<'a, 'py, K> IntoPyObject<'py> for &'a BTreeSet<K>
Source§impl<'a, 'py, K, H> IntoPyObject<'py> for &'a HashSet<K, H>
impl<'a, 'py, K, H> IntoPyObject<'py> for &'a HashSet<K, H>
Source§impl<'a, 'py, K, H> IntoPyObject<'py> for &'a HashSet<K, H>
impl<'a, 'py, K, H> IntoPyObject<'py> for &'a HashSet<K, H>
Source§impl<'a, 'py, K, V> IntoPyObject<'py> for &'a BTreeMap<K, V>
impl<'a, 'py, K, V> IntoPyObject<'py> for &'a BTreeMap<K, V>
Source§impl<'a, 'py, K, V, H> IntoPyObject<'py> for &'a HashMap<K, V, H>
impl<'a, 'py, K, V, H> IntoPyObject<'py> for &'a HashMap<K, V, H>
Source§impl<'a, 'py, K, V, H> IntoPyObject<'py> for &'a HashMap<K, V, H>
impl<'a, 'py, K, V, H> IntoPyObject<'py> for &'a HashMap<K, V, H>
Source§impl<'a, 'py, K, V, H> IntoPyObject<'py> for &'a IndexMap<K, V, H>
impl<'a, 'py, K, V, H> IntoPyObject<'py> for &'a IndexMap<K, V, H>
Source§impl<'a, 'py, L, R> IntoPyObject<'py> for &'a Either<L, R>
impl<'a, 'py, L, R> IntoPyObject<'py> for &'a Either<L, R>
Source§impl<'a, 'py, T0> IntoPyObject<'py> for &'a (T0,)where
&'a T0: IntoPyObject<'py>,
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)
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)
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)where
&'a T0: IntoPyObject<'py>,
&'a T1: IntoPyObject<'py>,
&'a T2: IntoPyObject<'py>,
&'a T3: IntoPyObject<'py>,
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>,
Source§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>,
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>,
Source§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>,
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>,
Source§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>,
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>,
const OUTPUT_TYPE: TypeHint
type Target = PyTuple
type Output = Bound<'py, <&'a (T0, T1, T2, T3, T4, T5, T6) as IntoPyObject<'py>>::Target>
type Error = PyErr
fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>
fn type_output() -> TypeInfo
Source§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>,
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>,
const OUTPUT_TYPE: TypeHint
type Target = PyTuple
type Output = Bound<'py, <&'a (T0, T1, T2, T3, T4, T5, T6, T7) as IntoPyObject<'py>>::Target>
type Error = PyErr
fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>
fn type_output() -> TypeInfo
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)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>,
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>,
const OUTPUT_TYPE: TypeHint
type Target = PyTuple
type Output = Bound<'py, <&'a (T0, T1, T2, T3, T4, T5, T6, T7, T8) as IntoPyObject<'py>>::Target>
type Error = PyErr
fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>
fn type_output() -> TypeInfo
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)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>,
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>,
const OUTPUT_TYPE: TypeHint
type Target = PyTuple
type Output = Bound<'py, <&'a (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9) as IntoPyObject<'py>>::Target>
type Error = PyErr
fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>
fn type_output() -> TypeInfo
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)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>,
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>,
const OUTPUT_TYPE: TypeHint
type Target = PyTuple
type Output = Bound<'py, <&'a (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10) as IntoPyObject<'py>>::Target>
type Error = PyErr
fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>
fn type_output() -> TypeInfo
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)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>,
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>,
const OUTPUT_TYPE: TypeHint
type Target = PyTuple
type Output = Bound<'py, <&'a (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11) as IntoPyObject<'py>>::Target>
type Error = PyErr
fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>
fn type_output() -> TypeInfo
Source§impl<'a, 'py, T> IntoPyObject<'py> for &'a Option<T>where
&'a T: IntoPyObject<'py>,
impl<'a, 'py, T> IntoPyObject<'py> for &'a Option<T>where
&'a T: IntoPyObject<'py>,
const OUTPUT_TYPE: TypeHint = Option<&T>::OUTPUT_TYPE
type Target = PyAny
type Output = Bound<'py, <&'a Option<T> as IntoPyObject<'py>>::Target>
type Error = <&'a T as IntoPyObject<'py>>::Error
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>,
impl<'a, 'py, T> IntoPyObject<'py> for &'a [T]where
&'a T: IntoPyObject<'py>,
const OUTPUT_TYPE: TypeHint = <&T>::SEQUENCE_OUTPUT_TYPE
type Target = PyAny
type Output = Bound<'py, <&'a [T] as IntoPyObject<'py>>::Target>
type Error = PyErr
fn type_output() -> TypeInfo
Source§impl<'a, 'py, T> IntoPyObject<'py> for &'a Vec<T>where
&'a T: IntoPyObject<'py>,
impl<'a, 'py, T> IntoPyObject<'py> for &'a Vec<T>where
&'a T: IntoPyObject<'py>,
Source§impl<'a, 'py, T> IntoPyObject<'py> for &&'a Twhere
&'a T: IntoPyObject<'py>,
impl<'a, 'py, T> IntoPyObject<'py> for &&'a Twhere
&'a T: IntoPyObject<'py>,
Source§impl<'a, 'py, T, const N: usize> IntoPyObject<'py> for &'a [T; N]where
&'a T: IntoPyObject<'py>,
impl<'a, 'py, T, const N: usize> IntoPyObject<'py> for &'a [T; N]where
&'a T: IntoPyObject<'py>,
Source§impl<'py> IntoPyObject<'py> for &&str
impl<'py> IntoPyObject<'py> for &&str
const OUTPUT_TYPE: TypeHint = String::OUTPUT_TYPE
type Target = PyString
type Output = Bound<'py, <&&str as IntoPyObject<'py>>::Target>
type Error = Infallible
fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>
fn type_output() -> TypeInfo
Source§impl<'py> IntoPyObject<'py> for &&OsStr
impl<'py> IntoPyObject<'py> for &&OsStr
Source§impl<'py> IntoPyObject<'py> for &&Path
impl<'py> IntoPyObject<'py> for &&Path
Source§impl<'py> IntoPyObject<'py> for &Cow<'_, str>
impl<'py> IntoPyObject<'py> for &Cow<'_, str>
const OUTPUT_TYPE: TypeHint = String::OUTPUT_TYPE
type Target = PyString
type Output = Bound<'py, <&Cow<'_, str> as IntoPyObject<'py>>::Target>
type Error = Infallible
fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>
fn type_output() -> TypeInfo
Source§impl<'py> IntoPyObject<'py> for &Cow<'_, CStr>
impl<'py> IntoPyObject<'py> for &Cow<'_, CStr>
Source§impl<'py> IntoPyObject<'py> for &Cow<'_, OsStr>
impl<'py> IntoPyObject<'py> for &Cow<'_, OsStr>
Source§impl<'py> IntoPyObject<'py> for &Cow<'_, Path>
impl<'py> IntoPyObject<'py> for &Cow<'_, Path>
Source§impl<'py> IntoPyObject<'py> for &IpAddr
impl<'py> IntoPyObject<'py> for &IpAddr
Source§impl<'py> IntoPyObject<'py> for &bool
impl<'py> IntoPyObject<'py> for &bool
const OUTPUT_TYPE: TypeHint = bool::OUTPUT_TYPE
type Target = PyBool
type Output = Borrowed<'py, 'py, <&bool as IntoPyObject<'py>>::Target>
type Error = Infallible
fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>
fn type_output() -> TypeInfo
Source§impl<'py> IntoPyObject<'py> for &char
impl<'py> IntoPyObject<'py> for &char
const OUTPUT_TYPE: TypeHint = String::OUTPUT_TYPE
type Target = PyString
type Output = Bound<'py, <&char as IntoPyObject<'py>>::Target>
type Error = Infallible
fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>
fn type_output() -> TypeInfo
Source§impl<'py> IntoPyObject<'py> for &f32
impl<'py> IntoPyObject<'py> for &f32
Source§impl<'py> IntoPyObject<'py> for &f64
impl<'py> IntoPyObject<'py> for &f64
Source§impl<'py> IntoPyObject<'py> for &i8
impl<'py> IntoPyObject<'py> for &i8
Source§impl<'py> IntoPyObject<'py> for &i16
impl<'py> IntoPyObject<'py> for &i16
Source§impl<'py> IntoPyObject<'py> for &i32
impl<'py> IntoPyObject<'py> for &i32
Source§impl<'py> IntoPyObject<'py> for &i64
impl<'py> IntoPyObject<'py> for &i64
Source§impl<'py> IntoPyObject<'py> for &i128
impl<'py> IntoPyObject<'py> for &i128
Source§impl<'py> IntoPyObject<'py> for &isize
impl<'py> IntoPyObject<'py> for &isize
Source§impl<'py> IntoPyObject<'py> for &str
impl<'py> IntoPyObject<'py> for &str
const OUTPUT_TYPE: TypeHint = String::OUTPUT_TYPE
type Target = PyString
type Output = Bound<'py, <&str as IntoPyObject<'py>>::Target>
type Error = Infallible
fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>
fn type_output() -> TypeInfo
Source§impl<'py> IntoPyObject<'py> for &u8
impl<'py> IntoPyObject<'py> for &u8
Source§impl<'py> IntoPyObject<'py> for &u16
impl<'py> IntoPyObject<'py> for &u16
Source§impl<'py> IntoPyObject<'py> for &u32
impl<'py> IntoPyObject<'py> for &u32
Source§impl<'py> IntoPyObject<'py> for &u64
impl<'py> IntoPyObject<'py> for &u64
Source§impl<'py> IntoPyObject<'py> for &u128
impl<'py> IntoPyObject<'py> for &u128
Source§impl<'py> IntoPyObject<'py> for &usize
impl<'py> IntoPyObject<'py> for &usize
Source§impl<'py> IntoPyObject<'py> for &CString
impl<'py> IntoPyObject<'py> for &CString
Source§impl<'py> IntoPyObject<'py> for &String
impl<'py> IntoPyObject<'py> for &String
const OUTPUT_TYPE: TypeHint = String::OUTPUT_TYPE
type Target = PyString
type Output = Bound<'py, <&String as IntoPyObject<'py>>::Target>
type Error = Infallible
fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>
fn type_output() -> TypeInfo
Source§impl<'py> IntoPyObject<'py> for &CStr
impl<'py> IntoPyObject<'py> for &CStr
Source§impl<'py> IntoPyObject<'py> for &Ipv4Addr
impl<'py> IntoPyObject<'py> for &Ipv4Addr
Source§impl<'py> IntoPyObject<'py> for &Ipv6Addr
impl<'py> IntoPyObject<'py> for &Ipv6Addr
Source§impl<'py> IntoPyObject<'py> for &Duration
impl<'py> IntoPyObject<'py> for &Duration
Source§impl<'py> IntoPyObject<'py> for &OsStr
impl<'py> IntoPyObject<'py> for &OsStr
Source§impl<'py> IntoPyObject<'py> for &OsString
impl<'py> IntoPyObject<'py> for &OsString
Source§impl<'py> IntoPyObject<'py> for &Path
impl<'py> IntoPyObject<'py> for &Path
Source§impl<'py> IntoPyObject<'py> for &PathBuf
impl<'py> IntoPyObject<'py> for &PathBuf
Source§impl<'py> IntoPyObject<'py> for &SystemTime
impl<'py> IntoPyObject<'py> for &SystemTime
Source§impl<'py> IntoPyObject<'py> for &NaiveDate
impl<'py> IntoPyObject<'py> for &NaiveDate
Source§impl<'py> IntoPyObject<'py> for &NaiveDateTime
impl<'py> IntoPyObject<'py> for &NaiveDateTime
Source§impl<'py> IntoPyObject<'py> for &NaiveTime
impl<'py> IntoPyObject<'py> for &NaiveTime
Source§impl<'py> IntoPyObject<'py> for &FixedOffset
impl<'py> IntoPyObject<'py> for &FixedOffset
Source§impl<'py> IntoPyObject<'py> for &Local
Available on crate feature chrono-local only.
impl<'py> IntoPyObject<'py> for &Local
chrono-local only.Source§impl<'py> IntoPyObject<'py> for &Utc
impl<'py> IntoPyObject<'py> for &Utc
Source§impl<'py> IntoPyObject<'py> for &BigInt
impl<'py> IntoPyObject<'py> for &BigInt
Source§impl<'py> IntoPyObject<'py> for &BigUint
impl<'py> IntoPyObject<'py> for &BigUint
Source§impl<'py> IntoPyObject<'py> for &Complex<f32>
impl<'py> IntoPyObject<'py> for &Complex<f32>
Source§impl<'py> IntoPyObject<'py> for &Complex<f64>
impl<'py> IntoPyObject<'py> for &Complex<f64>
Source§impl<'py> IntoPyObject<'py> for &Ratio<i8>
impl<'py> IntoPyObject<'py> for &Ratio<i8>
Source§impl<'py> IntoPyObject<'py> for &Ratio<i16>
impl<'py> IntoPyObject<'py> for &Ratio<i16>
Source§impl<'py> IntoPyObject<'py> for &Ratio<i32>
impl<'py> IntoPyObject<'py> for &Ratio<i32>
Source§impl<'py> IntoPyObject<'py> for &Ratio<i64>
impl<'py> IntoPyObject<'py> for &Ratio<i64>
Source§impl<'py> IntoPyObject<'py> for &Ratio<isize>
impl<'py> IntoPyObject<'py> for &Ratio<isize>
Source§impl<'py> IntoPyObject<'py> for &Ratio<BigInt>
impl<'py> IntoPyObject<'py> for &Ratio<BigInt>
Source§impl<'py> IntoPyObject<'py> for &Uuid
impl<'py> IntoPyObject<'py> for &Uuid
Source§impl<'py> IntoPyObject<'py> for &NonZeroI8
impl<'py> IntoPyObject<'py> for &NonZeroI8
const OUTPUT_TYPE: TypeHint = NonZeroI8::OUTPUT_TYPE
type Target = PyInt
type Output = Bound<'py, <&NonZero<i8> as IntoPyObject<'py>>::Target>
type Error = Infallible
fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>
fn type_output() -> TypeInfo
Source§impl<'py> IntoPyObject<'py> for &NonZeroI16
impl<'py> IntoPyObject<'py> for &NonZeroI16
const OUTPUT_TYPE: TypeHint = NonZeroI16::OUTPUT_TYPE
type Target = PyInt
type Output = Bound<'py, <&NonZero<i16> as IntoPyObject<'py>>::Target>
type Error = Infallible
fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>
fn type_output() -> TypeInfo
Source§impl<'py> IntoPyObject<'py> for &NonZeroI32
impl<'py> IntoPyObject<'py> for &NonZeroI32
const OUTPUT_TYPE: TypeHint = NonZeroI32::OUTPUT_TYPE
type Target = PyInt
type Output = Bound<'py, <&NonZero<i32> as IntoPyObject<'py>>::Target>
type Error = Infallible
fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>
fn type_output() -> TypeInfo
Source§impl<'py> IntoPyObject<'py> for &NonZeroI64
impl<'py> IntoPyObject<'py> for &NonZeroI64
const OUTPUT_TYPE: TypeHint = NonZeroI64::OUTPUT_TYPE
type Target = PyInt
type Output = Bound<'py, <&NonZero<i64> as IntoPyObject<'py>>::Target>
type Error = Infallible
fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>
fn type_output() -> TypeInfo
Source§impl<'py> IntoPyObject<'py> for &NonZeroI128
impl<'py> IntoPyObject<'py> for &NonZeroI128
const OUTPUT_TYPE: TypeHint = NonZeroI128::OUTPUT_TYPE
type Target = PyInt
type Output = Bound<'py, <&NonZero<i128> as IntoPyObject<'py>>::Target>
type Error = Infallible
fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>
fn type_output() -> TypeInfo
Source§impl<'py> IntoPyObject<'py> for &NonZeroIsize
impl<'py> IntoPyObject<'py> for &NonZeroIsize
const OUTPUT_TYPE: TypeHint = NonZeroIsize::OUTPUT_TYPE
type Target = PyInt
type Output = Bound<'py, <&NonZero<isize> as IntoPyObject<'py>>::Target>
type Error = Infallible
fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>
fn type_output() -> TypeInfo
Source§impl<'py> IntoPyObject<'py> for &NonZeroU8
impl<'py> IntoPyObject<'py> for &NonZeroU8
const OUTPUT_TYPE: TypeHint = NonZeroU8::OUTPUT_TYPE
type Target = PyInt
type Output = Bound<'py, <&NonZero<u8> as IntoPyObject<'py>>::Target>
type Error = Infallible
fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>
fn type_output() -> TypeInfo
Source§impl<'py> IntoPyObject<'py> for &NonZeroU16
impl<'py> IntoPyObject<'py> for &NonZeroU16
const OUTPUT_TYPE: TypeHint = NonZeroU16::OUTPUT_TYPE
type Target = PyInt
type Output = Bound<'py, <&NonZero<u16> as IntoPyObject<'py>>::Target>
type Error = Infallible
fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>
fn type_output() -> TypeInfo
Source§impl<'py> IntoPyObject<'py> for &NonZeroU32
impl<'py> IntoPyObject<'py> for &NonZeroU32
const OUTPUT_TYPE: TypeHint = NonZeroU32::OUTPUT_TYPE
type Target = PyInt
type Output = Bound<'py, <&NonZero<u32> as IntoPyObject<'py>>::Target>
type Error = Infallible
fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>
fn type_output() -> TypeInfo
Source§impl<'py> IntoPyObject<'py> for &NonZeroU64
impl<'py> IntoPyObject<'py> for &NonZeroU64
const OUTPUT_TYPE: TypeHint = NonZeroU64::OUTPUT_TYPE
type Target = PyInt
type Output = Bound<'py, <&NonZero<u64> as IntoPyObject<'py>>::Target>
type Error = Infallible
fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>
fn type_output() -> TypeInfo
Source§impl<'py> IntoPyObject<'py> for &NonZeroU128
impl<'py> IntoPyObject<'py> for &NonZeroU128
const OUTPUT_TYPE: TypeHint = NonZeroU128::OUTPUT_TYPE
type Target = PyInt
type Output = Bound<'py, <&NonZero<u128> as IntoPyObject<'py>>::Target>
type Error = Infallible
fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>
fn type_output() -> TypeInfo
Source§impl<'py> IntoPyObject<'py> for &NonZeroUsize
impl<'py> IntoPyObject<'py> for &NonZeroUsize
const OUTPUT_TYPE: TypeHint = NonZeroUsize::OUTPUT_TYPE
type Target = PyInt
type Output = Bound<'py, <&NonZero<usize> as IntoPyObject<'py>>::Target>
type Error = Infallible
fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>
fn type_output() -> TypeInfo
Source§impl<'py> IntoPyObject<'py> for &Duration
impl<'py> IntoPyObject<'py> for &Duration
Source§impl<'py> IntoPyObject<'py> for &Bytes
impl<'py> IntoPyObject<'py> for &Bytes
Source§impl<'py> IntoPyObject<'py> for &Date
impl<'py> IntoPyObject<'py> for &Date
Source§impl<'py> IntoPyObject<'py> for &Date
impl<'py> IntoPyObject<'py> for &Date
Source§impl<'py> IntoPyObject<'py> for &DateTime
impl<'py> IntoPyObject<'py> for &DateTime
Source§impl<'py> IntoPyObject<'py> for &Decimal
impl<'py> IntoPyObject<'py> for &Decimal
Source§impl<'py> IntoPyObject<'py> for &Duration
impl<'py> IntoPyObject<'py> for &Duration
Source§impl<'py> IntoPyObject<'py> for &ISOWeekDate
impl<'py> IntoPyObject<'py> for &ISOWeekDate
Source§impl<'py> IntoPyObject<'py> for &NotNan<f32>
impl<'py> IntoPyObject<'py> for &NotNan<f32>
Source§impl<'py> IntoPyObject<'py> for &NotNan<f64>
impl<'py> IntoPyObject<'py> for &NotNan<f64>
Source§impl<'py> IntoPyObject<'py> for &Offset
impl<'py> IntoPyObject<'py> for &Offset
Source§impl<'py> IntoPyObject<'py> for &OffsetDateTime
impl<'py> IntoPyObject<'py> for &OffsetDateTime
Source§impl<'py> IntoPyObject<'py> for &OrderedFloat<f32>
impl<'py> IntoPyObject<'py> for &OrderedFloat<f32>
Source§impl<'py> IntoPyObject<'py> for &OrderedFloat<f64>
impl<'py> IntoPyObject<'py> for &OrderedFloat<f64>
Source§impl<'py> IntoPyObject<'py> for &PrimitiveDateTime
impl<'py> IntoPyObject<'py> for &PrimitiveDateTime
Source§impl<'py> IntoPyObject<'py> for &SignedDuration
impl<'py> IntoPyObject<'py> for &SignedDuration
Source§impl<'py> IntoPyObject<'py> for &Time
impl<'py> IntoPyObject<'py> for &Time
Source§impl<'py> IntoPyObject<'py> for &Time
impl<'py> IntoPyObject<'py> for &Time
Source§impl<'py> IntoPyObject<'py> for &TimeZone
impl<'py> IntoPyObject<'py> for &TimeZone
Source§impl<'py> IntoPyObject<'py> for &Timestamp
impl<'py> IntoPyObject<'py> for &Timestamp
Source§impl<'py> IntoPyObject<'py> for &Tz
impl<'py> IntoPyObject<'py> for &Tz
Source§impl<'py> IntoPyObject<'py> for &UtcDateTime
impl<'py> IntoPyObject<'py> for &UtcDateTime
Source§impl<'py> IntoPyObject<'py> for &UtcOffset
impl<'py> IntoPyObject<'py> for &UtcOffset
Source§impl<'py> IntoPyObject<'py> for &Zoned
impl<'py> IntoPyObject<'py> for &Zoned
Source§impl<'py> IntoPyObject<'py> for Cow<'_, str>
impl<'py> IntoPyObject<'py> for Cow<'_, str>
const OUTPUT_TYPE: TypeHint = String::OUTPUT_TYPE
type Target = PyString
type Output = Bound<'py, <Cow<'_, str> as IntoPyObject<'py>>::Target>
type Error = Infallible
fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>
fn type_output() -> TypeInfo
Source§impl<'py> IntoPyObject<'py> for Cow<'_, CStr>
impl<'py> IntoPyObject<'py> for Cow<'_, CStr>
Source§impl<'py> IntoPyObject<'py> for Cow<'_, OsStr>
impl<'py> IntoPyObject<'py> for Cow<'_, OsStr>
Source§impl<'py> IntoPyObject<'py> for Cow<'_, Path>
impl<'py> IntoPyObject<'py> for Cow<'_, Path>
Source§impl<'py> IntoPyObject<'py> for IpAddr
impl<'py> IntoPyObject<'py> for IpAddr
Source§impl<'py> IntoPyObject<'py> for bool
impl<'py> IntoPyObject<'py> for bool
const OUTPUT_TYPE: TypeHint = PyBool::TYPE_HINT
type Target = PyBool
type Output = Borrowed<'py, 'py, <bool as IntoPyObject<'py>>::Target>
type Error = Infallible
fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>
fn type_output() -> TypeInfo
Source§impl<'py> IntoPyObject<'py> for char
impl<'py> IntoPyObject<'py> for char
const OUTPUT_TYPE: TypeHint = String::OUTPUT_TYPE
type Target = PyString
type Output = Bound<'py, <char as IntoPyObject<'py>>::Target>
type Error = Infallible
fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>
fn type_output() -> TypeInfo
Source§impl<'py> IntoPyObject<'py> for f32
impl<'py> IntoPyObject<'py> for f32
Source§impl<'py> IntoPyObject<'py> for f64
impl<'py> IntoPyObject<'py> for f64
Source§impl<'py> IntoPyObject<'py> for i8
impl<'py> IntoPyObject<'py> for i8
Source§impl<'py> IntoPyObject<'py> for i16
impl<'py> IntoPyObject<'py> for i16
Source§impl<'py> IntoPyObject<'py> for i32
impl<'py> IntoPyObject<'py> for i32
Source§impl<'py> IntoPyObject<'py> for i64
impl<'py> IntoPyObject<'py> for i64
Source§impl<'py> IntoPyObject<'py> for i128
impl<'py> IntoPyObject<'py> for i128
Source§impl<'py> IntoPyObject<'py> for isize
impl<'py> IntoPyObject<'py> for isize
Source§impl<'py> IntoPyObject<'py> for u8
impl<'py> IntoPyObject<'py> for u8
Source§impl<'py> IntoPyObject<'py> for u16
impl<'py> IntoPyObject<'py> for u16
Source§impl<'py> IntoPyObject<'py> for u32
impl<'py> IntoPyObject<'py> for u32
Source§impl<'py> IntoPyObject<'py> for u64
impl<'py> IntoPyObject<'py> for u64
Source§impl<'py> IntoPyObject<'py> for u128
impl<'py> IntoPyObject<'py> for u128
Source§impl<'py> IntoPyObject<'py> for ()
impl<'py> IntoPyObject<'py> for ()
Source§impl<'py> IntoPyObject<'py> for usize
impl<'py> IntoPyObject<'py> for usize
Source§impl<'py> IntoPyObject<'py> for CString
impl<'py> IntoPyObject<'py> for CString
Source§impl<'py> IntoPyObject<'py> for String
impl<'py> IntoPyObject<'py> for String
const OUTPUT_TYPE: TypeHint = PyString::TYPE_HINT
type Target = PyString
type Output = Bound<'py, <String as IntoPyObject<'py>>::Target>
type Error = Infallible
fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>
fn type_output() -> TypeInfo
Source§impl<'py> IntoPyObject<'py> for Ipv4Addr
impl<'py> IntoPyObject<'py> for Ipv4Addr
Source§impl<'py> IntoPyObject<'py> for Ipv6Addr
impl<'py> IntoPyObject<'py> for Ipv6Addr
Source§impl<'py> IntoPyObject<'py> for Duration
impl<'py> IntoPyObject<'py> for Duration
Source§impl<'py> IntoPyObject<'py> for OsString
impl<'py> IntoPyObject<'py> for OsString
Source§impl<'py> IntoPyObject<'py> for PathBuf
impl<'py> IntoPyObject<'py> for PathBuf
Source§impl<'py> IntoPyObject<'py> for SystemTime
impl<'py> IntoPyObject<'py> for SystemTime
Source§impl<'py> IntoPyObject<'py> for NaiveDate
impl<'py> IntoPyObject<'py> for NaiveDate
Source§impl<'py> IntoPyObject<'py> for NaiveDateTime
impl<'py> IntoPyObject<'py> for NaiveDateTime
Source§impl<'py> IntoPyObject<'py> for NaiveTime
impl<'py> IntoPyObject<'py> for NaiveTime
Source§impl<'py> IntoPyObject<'py> for FixedOffset
impl<'py> IntoPyObject<'py> for FixedOffset
Source§impl<'py> IntoPyObject<'py> for Local
Available on crate feature chrono-local only.
impl<'py> IntoPyObject<'py> for Local
chrono-local only.