Trait for types which can represent a Python mapping and have a name
| 32 | |
| 33 | /// Trait for types which can represent a Python mapping and have a name |
| 34 | pub 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 |
| 57 | pub trait PythonizeListType: Sized { |
nothing calls this directly
no outgoing calls
no test coverage detected