alef 0.34.5

Opinionated polyglot binding generator for Rust libraries
Documentation
1
2
3
4
5
6
7
8
9
{# from_json bridge fns stay unconditional: frb_generated.rs wires them in regardless #}
{# of feature flags, and the mirror crate pins the core dependency with its full #}
{# feature set. See rust_mirror_enum_attribute.jinja for the full rationale. #}
#[frb]
pub fn {{ fn_name }}(json: String) -> Result<{{ type_name }}, String> {
    serde_json::from_str::<{{ core_ty }}>(&json)
        .map({{ type_name }}::from)
        .map_err(|e| e.to_string())
}