pyo3::types

Trait IntoPyDict

Source
pub trait IntoPyDict<'py>: Sized {
    // Required method
    fn into_py_dict(self, py: Python<'py>) -> PyResult<Bound<'py, PyDict>>;

    // Provided method
    fn into_py_dict_bound(self, py: Python<'py>) -> Bound<'py, PyDict> { ... }
}
Expand description

Conversion trait that allows a sequence of tuples to be converted into PyDict Primary use case for this trait is call and call_method methods as keywords argument.

Required Methods§

Source

fn into_py_dict(self, py: Python<'py>) -> PyResult<Bound<'py, PyDict>>

Converts self into a PyDict object pointer. Whether pointer owned or borrowed depends on implementation.

Provided Methods§

Source

fn into_py_dict_bound(self, py: Python<'py>) -> Bound<'py, PyDict>

👎Deprecated since 0.23.0: renamed to IntoPyDict::into_py_dict

Deprecated name for IntoPyDict::into_py_dict.

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.

Implementors§

Source§

impl<'py, T, I> IntoPyDict<'py> for I
where T: PyDictItem<'py>, I: IntoIterator<Item = T>,