alef 0.23.39

Opinionated polyglot binding generator for Rust libraries
Documentation
1
2
3
4
5
6
7
8
9
10
    // 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 %}