Trait for types which can represent a Python mapping
| 13 | |
| 14 | /// Trait for types which can represent a Python mapping |
| 15 | pub trait PythonizeMappingType { |
| 16 | /// Builder type for Python mappings |
| 17 | type Builder<'py>: 'py; |
| 18 | |
| 19 | /// Create a builder for a Python mapping |
| 20 | fn builder<'py>(py: Python<'py>, len: Option<usize>) -> PyResult<Self::Builder<'py>>; |
| 21 | |
| 22 | /// Adds the key-value item to the mapping being built |
| 23 | fn push_item<'py>( |
| 24 | builder: &mut Self::Builder<'py>, |
| 25 | key: Bound<'py, PyAny>, |
| 26 | value: Bound<'py, PyAny>, |
| 27 | ) -> PyResult<()>; |
| 28 | |
| 29 | /// Build the Python mapping |
| 30 | fn finish<'py>(builder: Self::Builder<'py>) -> PyResult<Bound<'py, PyMapping>>; |
| 31 | } |
| 32 | |
| 33 | /// Trait for types which can represent a Python mapping and have a name |
| 34 | pub trait PythonizeNamedMappingType { |
nothing calls this directly
no outgoing calls
no test coverage detected