alef-codegen 0.15.3

Shared codegen utilities for the alef polyglot binding generator
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13

    fn __str__(&self) -> PyResult<String> {
        serde_json::to_value({{ value_expr }})
            .map(|value| match value {
                serde_json::Value::String(value) => value,
                other => other.to_string(),
            })
            .map_err(|e| pyo3::exceptions::PyRuntimeError::new_err(format!("Failed to serialize {{ name }}: {e}")))
    }

    fn __repr__(&self) -> PyResult<String> {
        self.__str__()
    }