alef 0.63.1

Opinionated polyglot binding generator for Rust libraries
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
    if handle == 0 {
        throw_jni_error(env, "native handle must not be zero");
        return {{ ret_null }};
    }
    // SAFETY: handle was allocated by the matching constructor shim and remains
    // valid until nativeFree is called. The Kotlin AutoCloseable.close() guarantee
    // ensures the handle outlives this call.
{% if receiver_owned %}
    let client: core_crate::{{ type_name }} = unsafe { (*(handle as *const core_crate::{{ type_name }})).clone() };
{% elif receiver_is_mut %}
    let client: &mut core_crate::{{ type_name }} = unsafe { &mut *(handle as *mut core_crate::{{ type_name }}) };
{% else %}
    let client: &core_crate::{{ type_name }} = unsafe { &*(handle as *const core_crate::{{ type_name }}) };
{% endif %}