pub trait ToPyObject {
// Required method
fn to_object(&self, py: Python<'_>) -> PyObject;
}
Expand description
Conversion trait that allows various objects to be converted into PyObject
.
Required Methods§
Implementations on Foreign Types§
Source§impl ToPyObject for Cow<'_, str>
Converts a Rust Cow<'_, str>
to a Python object.
See PyString::new
for details on the conversion.
impl ToPyObject for Cow<'_, str>
Converts a Rust Cow<'_, str>
to a Python object.
See PyString::new
for details on the conversion.
Source§impl ToPyObject for bool
Converts a Rust bool
to a Python bool
.
impl ToPyObject for bool
Converts a Rust bool
to a Python bool
.
Source§impl ToPyObject for str
Converts a Rust str
to a Python object.
See PyString::new
for details on the conversion.
impl ToPyObject for str
Converts a Rust str
to a Python object.
See PyString::new
for details on the conversion.
Source§impl ToPyObject for ()
()
is converted to Python None
.
impl ToPyObject for ()
()
is converted to Python None
.
Source§impl ToPyObject for String
Converts a Rust String
to a Python object.
See PyString::new
for details on the conversion.
impl ToPyObject for String
Converts a Rust String
to a Python object.
See PyString::new
for details on the conversion.
Source§impl ToPyObject for SystemTime
impl ToPyObject for SystemTime
Source§impl ToPyObject for NonZeroI16
impl ToPyObject for NonZeroI16
Source§impl ToPyObject for NonZeroI32
impl ToPyObject for NonZeroI32
Source§impl ToPyObject for NonZeroI64
impl ToPyObject for NonZeroI64
Source§impl ToPyObject for NonZeroI128
impl ToPyObject for NonZeroI128
Source§impl ToPyObject for NonZeroIsize
impl ToPyObject for NonZeroIsize
Source§impl ToPyObject for NonZeroU16
impl ToPyObject for NonZeroU16
Source§impl ToPyObject for NonZeroU32
impl ToPyObject for NonZeroU32
Source§impl ToPyObject for NonZeroU64
impl ToPyObject for NonZeroU64
Source§impl ToPyObject for NonZeroU128
impl ToPyObject for NonZeroU128
Source§impl ToPyObject for NonZeroUsize
impl ToPyObject for NonZeroUsize
Source§impl<K, V> ToPyObject for BTreeMap<K, V>
impl<K, V> ToPyObject for BTreeMap<K, V>
Source§impl<K, V, H> ToPyObject for HashMap<K, V, H>
impl<K, V, H> ToPyObject for HashMap<K, V, H>
Source§impl<T0: ToPyObject> ToPyObject for (T0,)
impl<T0: ToPyObject> ToPyObject for (T0,)
Source§impl<T0: ToPyObject, T1: ToPyObject> ToPyObject for (T0, T1)
impl<T0: ToPyObject, T1: ToPyObject> ToPyObject for (T0, T1)
Source§impl<T0: ToPyObject, T1: ToPyObject, T2: ToPyObject> ToPyObject for (T0, T1, T2)
impl<T0: ToPyObject, T1: ToPyObject, T2: ToPyObject> ToPyObject for (T0, T1, T2)
Source§impl<T0: ToPyObject, T1: ToPyObject, T2: ToPyObject, T3: ToPyObject> ToPyObject for (T0, T1, T2, T3)
impl<T0: ToPyObject, T1: ToPyObject, T2: ToPyObject, T3: ToPyObject> ToPyObject for (T0, T1, T2, T3)
Source§impl<T0: ToPyObject, T1: ToPyObject, T2: ToPyObject, T3: ToPyObject, T4: ToPyObject> ToPyObject for (T0, T1, T2, T3, T4)
impl<T0: ToPyObject, T1: ToPyObject, T2: ToPyObject, T3: ToPyObject, T4: ToPyObject> ToPyObject for (T0, T1, T2, T3, T4)
Source§impl<T0: ToPyObject, T1: ToPyObject, T2: ToPyObject, T3: ToPyObject, T4: ToPyObject, T5: ToPyObject> ToPyObject for (T0, T1, T2, T3, T4, T5)
impl<T0: ToPyObject, T1: ToPyObject, T2: ToPyObject, T3: ToPyObject, T4: ToPyObject, T5: ToPyObject> ToPyObject for (T0, T1, T2, T3, T4, T5)
Source§impl<T0: ToPyObject, T1: ToPyObject, T2: ToPyObject, T3: ToPyObject, T4: ToPyObject, T5: ToPyObject, T6: ToPyObject> ToPyObject for (T0, T1, T2, T3, T4, T5, T6)
impl<T0: ToPyObject, T1: ToPyObject, T2: ToPyObject, T3: ToPyObject, T4: ToPyObject, T5: ToPyObject, T6: ToPyObject> ToPyObject for (T0, T1, T2, T3, T4, T5, T6)
Source§impl<T0: ToPyObject, T1: ToPyObject, T2: ToPyObject, T3: ToPyObject, T4: ToPyObject, T5: ToPyObject, T6: ToPyObject, T7: ToPyObject> ToPyObject for (T0, T1, T2, T3, T4, T5, T6, T7)
impl<T0: ToPyObject, T1: ToPyObject, T2: ToPyObject, T3: ToPyObject, T4: ToPyObject, T5: ToPyObject, T6: ToPyObject, T7: ToPyObject> ToPyObject for (T0, T1, T2, T3, T4, T5, T6, T7)
Source§impl<T0: ToPyObject, T1: ToPyObject, T2: ToPyObject, T3: ToPyObject, T4: ToPyObject, T5: ToPyObject, T6: ToPyObject, T7: ToPyObject, T8: ToPyObject> ToPyObject for (T0, T1, T2, T3, T4, T5, T6, T7, T8)
impl<T0: ToPyObject, T1: ToPyObject, T2: ToPyObject, T3: ToPyObject, T4: ToPyObject, T5: ToPyObject, T6: ToPyObject, T7: ToPyObject, T8: ToPyObject> ToPyObject for (T0, T1, T2, T3, T4, T5, T6, T7, T8)
Source§impl<T0: ToPyObject, T1: ToPyObject, T2: ToPyObject, T3: ToPyObject, T4: ToPyObject, T5: ToPyObject, T6: ToPyObject, T7: ToPyObject, T8: ToPyObject, T9: ToPyObject> ToPyObject for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9)
impl<T0: ToPyObject, T1: ToPyObject, T2: ToPyObject, T3: ToPyObject, T4: ToPyObject, T5: ToPyObject, T6: ToPyObject, T7: ToPyObject, T8: ToPyObject, T9: ToPyObject> ToPyObject for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9)
Source§impl<T0: ToPyObject, T1: ToPyObject, T2: ToPyObject, T3: ToPyObject, T4: ToPyObject, T5: ToPyObject, T6: ToPyObject, T7: ToPyObject, T8: ToPyObject, T9: ToPyObject, T10: ToPyObject> ToPyObject for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)
impl<T0: ToPyObject, T1: ToPyObject, T2: ToPyObject, T3: ToPyObject, T4: ToPyObject, T5: ToPyObject, T6: ToPyObject, T7: ToPyObject, T8: ToPyObject, T9: ToPyObject, T10: ToPyObject> ToPyObject for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)
Source§impl<T0: ToPyObject, T1: ToPyObject, T2: ToPyObject, T3: ToPyObject, T4: ToPyObject, T5: ToPyObject, T6: ToPyObject, T7: ToPyObject, T8: ToPyObject, T9: ToPyObject, T10: ToPyObject, T11: ToPyObject> ToPyObject for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)
impl<T0: ToPyObject, T1: ToPyObject, T2: ToPyObject, T3: ToPyObject, T4: ToPyObject, T5: ToPyObject, T6: ToPyObject, T7: ToPyObject, T8: ToPyObject, T9: ToPyObject, T10: ToPyObject, T11: ToPyObject> ToPyObject for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)
Source§impl<T> ToPyObject for Option<T>where
T: ToPyObject,
Option::Some<T>
is converted like T
.
Option::None
is converted to Python None
.
impl<T> ToPyObject for Option<T>where
T: ToPyObject,
Option::Some<T>
is converted like T
.
Option::None
is converted to Python None
.
Source§impl<T> ToPyObject for [T]where
T: ToPyObject,
impl<T> ToPyObject for [T]where
T: ToPyObject,
Source§impl<T> ToPyObject for BTreeSet<T>
impl<T> ToPyObject for BTreeSet<T>
Source§impl<T> ToPyObject for Vec<T>where
T: ToPyObject,
impl<T> ToPyObject for Vec<T>where
T: ToPyObject,
Source§impl<T, S> ToPyObject for HashSet<T, S>
impl<T, S> ToPyObject for HashSet<T, S>
Source§impl<T, const N: usize> ToPyObject for [T; N]where
T: ToPyObject,
impl<T, const N: usize> ToPyObject for [T; N]where
T: ToPyObject,
Source§impl<T: Copy + ToPyObject> ToPyObject for Cell<T>
impl<T: Copy + ToPyObject> ToPyObject for Cell<T>
Source§impl<T: ?Sized + ToPyObject> ToPyObject for &T
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
impl<T: ?Sized + ToPyObject> ToPyObject for &T
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.