Trait PythonizeNamedMappingType

Source
pub trait PythonizeNamedMappingType<'py> {
    type Builder;

    // Required methods
    fn builder(
        py: Python<'py>,
        len: usize,
        name: &'static str,
    ) -> PyResult<Self::Builder>;
    fn push_field(
        builder: &mut Self::Builder,
        name: Bound<'py, PyString>,
        value: Bound<'py, PyAny>,
    ) -> PyResult<()>;
    fn finish(builder: Self::Builder) -> PyResult<Bound<'py, PyMapping>>;
}
Expand description

Trait for types which can represent a Python mapping and have a name

Required Associated Types§

Source

type Builder

Builder type for Python mappings with a name

Required Methods§

Source

fn builder( py: Python<'py>, len: usize, name: &'static str, ) -> PyResult<Self::Builder>

Create a builder for a Python mapping with a name

Source

fn push_field( builder: &mut Self::Builder, name: Bound<'py, PyString>, value: Bound<'py, PyAny>, ) -> PyResult<()>

Adds the field to the named mapping being built

Source

fn finish(builder: Self::Builder) -> PyResult<Bound<'py, PyMapping>>

Build the Python mapping

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§