MCPcopy Index your code
hub / github.com/davidhewitt/pythonize / PythonizeNamedMappingType

Interface PythonizeNamedMappingType

src/ser.rs:34–54  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

32
33/// Trait for types which can represent a Python mapping and have a name
34pub trait PythonizeNamedMappingType {
35 /// Builder type for Python mappings with a name
36 type Builder<'py>: 'py;
37
38 /// Create a builder for a Python mapping with a name
39 fn builder<'py>(
40 py: Python<'py>,
41 len: usize,
42 name: &'static str,
43 ) -> PyResult<Self::Builder<'py>>;
44
45 /// Adds the field to the named mapping being built
46 fn push_field<'py>(
47 builder: &mut Self::Builder<'py>,
48 name: Bound<'py, PyString>,
49 value: Bound<'py, PyAny>,
50 ) -> PyResult<()>;
51
52 /// Build the Python mapping
53 fn finish<'py>(builder: Self::Builder<'py>) -> PyResult<Bound<'py, PyMapping>>;
54}
55
56/// Trait for types which can represent a Python sequence
57pub trait PythonizeListType: Sized {

Callers

nothing calls this directly

Implementers 2

ser.rssrc/ser.rs
test_custom_types.rstests/test_custom_types.rs

Calls

no outgoing calls

Tested by

no test coverage detected