Trait pyo3::conversion::ToPyObject
source · [−]Expand description
Conversion trait that allows various objects to be converted into PyObject
.
Required Methods
Implementations on Foreign Types
sourceimpl<T: ?Sized + ToPyObject> ToPyObject for &T
impl<T: ?Sized + ToPyObject> ToPyObject for &T
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
sourceimpl<T> ToPyObject for Option<T> where
T: ToPyObject,
impl<T> ToPyObject for Option<T> where
T: ToPyObject,
Option::Some<T>
is converted like T
.
Option::None
is converted to Python None
.
sourceimpl ToPyObject for ()
impl ToPyObject for ()
()
is converted to Python None
.
sourceimpl<K, V, H> ToPyObject for HashMap<K, V, H> where
K: Hash + Eq + ToPyObject,
V: ToPyObject,
H: BuildHasher,
impl<K, V, H> ToPyObject for HashMap<K, V, H> where
K: Hash + Eq + ToPyObject,
V: ToPyObject,
H: BuildHasher,
sourceimpl<T> ToPyObject for HashSet<T> where
T: Hash + Eq + ToPyObject,
impl<T> ToPyObject for HashSet<T> where
T: Hash + Eq + ToPyObject,
sourceimpl<K, V, H> ToPyObject for IndexMap<K, V, H> where
K: Hash + Eq + ToPyObject,
V: ToPyObject,
H: BuildHasher,
impl<K, V, H> ToPyObject for IndexMap<K, V, H> where
K: Hash + Eq + ToPyObject,
V: ToPyObject,
H: BuildHasher,
sourceimpl ToPyObject for BigUint
Available on crate feature num-bigint
only.
impl ToPyObject for BigUint
Available on crate feature
num-bigint
only.sourceimpl ToPyObject for BigInt
Available on crate feature num-bigint
only.
impl ToPyObject for BigInt
Available on crate feature
num-bigint
only.sourceimpl ToPyObject for Complex<f32>
Available on crate feature num-complex
only.
impl ToPyObject for Complex<f32>
Available on crate feature
num-complex
only.sourceimpl ToPyObject for Complex<f64>
Available on crate feature num-complex
only.
impl ToPyObject for Complex<f64>
Available on crate feature
num-complex
only.sourceimpl ToPyObject for bool
impl ToPyObject for bool
Converts a Rust bool
to a Python bool
.
sourceimpl<K, V, H> ToPyObject for HashMap<K, V, H> where
K: Hash + Eq + ToPyObject,
V: ToPyObject,
H: BuildHasher,
impl<K, V, H> ToPyObject for HashMap<K, V, H> where
K: Hash + Eq + ToPyObject,
V: ToPyObject,
H: BuildHasher,
sourceimpl<K, V> ToPyObject for BTreeMap<K, V> where
K: Eq + ToPyObject,
V: ToPyObject,
impl<K, V> ToPyObject for BTreeMap<K, V> where
K: Eq + ToPyObject,
V: ToPyObject,
sourceimpl<T> ToPyObject for [T] where
T: ToPyObject,
impl<T> ToPyObject for [T] where
T: ToPyObject,
sourceimpl<T> ToPyObject for Vec<T> where
T: ToPyObject,
impl<T> ToPyObject for Vec<T> where
T: ToPyObject,
sourceimpl<T, S> ToPyObject for HashSet<T, S> where
T: Hash + Eq + ToPyObject,
S: BuildHasher + Default,
impl<T, S> ToPyObject for HashSet<T, S> where
T: Hash + Eq + ToPyObject,
S: BuildHasher + Default,
sourceimpl<T> ToPyObject for BTreeSet<T> where
T: Hash + Eq + ToPyObject,
impl<T> ToPyObject for BTreeSet<T> where
T: Hash + Eq + ToPyObject,
sourceimpl ToPyObject for str
impl ToPyObject for str
Converts a Rust str
to a Python object.
See PyString::new
for details on the conversion.
sourceimpl<'a> ToPyObject for Cow<'a, str>
impl<'a> ToPyObject for Cow<'a, str>
Converts a Rust Cow<'_, str>
to a Python object.
See PyString::new
for details on the conversion.
sourceimpl ToPyObject for String
impl ToPyObject for String
Converts a Rust String
to a Python object.
See PyString::new
for details on the conversion.