alef 0.25.37

Opinionated polyglot binding generator for Rust libraries
Documentation
1
2
3
4
5
6
7
8
9
10
/// Register a Dart implementation as a `{{ trait_name }}` plugin.
///
/// Forwards the `Arc<dyn {{ trait_name }}>` wrapped by `{{ struct_name }}` to
/// `{{ registry_getter }}()`. Errors from the host registry are stringified
/// for FRB transport.
pub fn {{ register_fn }}(impl_: {{ struct_name }}) -> Result<(), String> {
    let registry = {{ registry_getter }}();
    let mut registry = registry.write();
    registry.register(impl_.field0{{ extra_args }}).map_err(|e| e.to_string())
}