alef 0.67.4

Opinionated polyglot binding generator for Rust libraries
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#[unsafe(no_mangle)]
pub unsafe extern "system" fn {{ symbol }}(
    mut env: EnvUnowned,
    _class: JClass,
) {
    // SAFETY: env is a valid EnvUnowned passed by the JVM for this native call frame.
    let mut __jni_attach_guard = unsafe { jni::AttachGuard::from_unowned(env.as_raw()) };
    let env = __jni_attach_guard.borrow_env_mut();
    let Some(()) = run_or_throw(env, |env| {
    let result = core_crate::{{ clear_fn }}();
    if let Err(e) = result {
        throw_jni_error(env, &e.to_string());
    }
    }) else {
        return;
    };
}