alef 0.24.13

Opinionated polyglot binding generator for Rust libraries
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{% if is_run %}
    let rt = tokio::runtime::Runtime::new().map_err(|_e| {
        NifError::Atom("runtime_error")
    })?;

    let result = rt.block_on(owner.{{ ep_method }}({{ ep_params }}));
    match result {
        Ok(_) => Ok(atoms::ok()),
        Err(_e) => Err(NifError::Atom("error")),
    }
{% else %}
    match owner.{{ ep_method }}({{ ep_params }}) {
        Ok(_) => Ok(atoms::ok()),
        Err(_e) => Err(NifError::Atom("error")),
    }
{% endif %}