Trait pyo3::conversion::ToPyObject [−][src]
Expand description
Conversion trait that allows various objects to be converted into PyObject
.
Required methods
Implementations on Foreign Types
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
Option::Some<T>
is converted like T
.
Option::None
is converted to Python None
.
()
is converted to Python None
.
Converts a Rust bool
to a Python bool
.
impl<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,
impl<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,
Converts a Rust str
to a Python object.
See PyString::new
for details on the conversion.
Converts a Rust Cow<str>
to a Python object.
See PyString::new
for details on the conversion.
Converts a Rust String
to a Python object.
See PyString::new
for details on the conversion.