cargo jni 0.20.0
Rust JNI 0.20.0

latest releases: 0.21.1, 0.21.0
18 months ago

Added

  • Default trait implemented for JObject, JString, JClass, and JByteBuffer (#199)
  • Debug trait implemented for JavaVM, GlobalRef, GlobalRefGuard, JStaticMethodID and ReleaseMode (#345)
  • ReturnType for specifying object return types without a String allocation. (#329)

Changed

  • The release_string_utf_chars function has been marked as unsafe. (#334)
  • Mark JNIEnv::new_direct_byte_buffer as unsafe (#320)
  • JNIEnv::new_direct_byte_buffer now takes a raw pointer and size instead of a slice (#351 and #364)
  • JNIEnv::direct_buffer_address returns a raw pointer instead of a slice (#364)
  • The lifetime of AutoArray is no longer tied to the lifetime of a particular JNIEnv reference. (#302)
  • Relaxed lifetime restrictions on JNIEnv::new_local_ref. Now it can be used to create a local
    reference from a global reference. (#301 / #319)
  • JMethodID and JStaticMethodID implement Send + Sync and no longer has a lifetime parameter, making method
    IDs cacheable (with a documented 'Safety' note about ensuring they remain valid). (#346)
  • JFieldID and JStaticFieldID implement Send + Sync and no longer has a lifetime parameter, making field
    IDs cacheable (with a documented 'Safety' note about ensuring they remain valid). (#346)
  • The call_*_method_unchecked functions now take jni:sys::jvalue arguments to avoid allocating
    a Vec on each call to map + collect JValues as sys:jvalues (#329)
  • The From trait implementations converting jni_sys types like jobject to JObject have been replaced
    with unsafe ::from_raw functions and corresponding ::into_raw methods. Existing ::into_inner APIs were
    renamed ::into_raw for symmetry. (#197)
  • The APIs JNIEnv::set_rust_field, JNIEnv::get_rust_field and JNIEnv::take_rust_field have been marked as unsafe (#219)

New Contributors

Full Changelog: v0.19.0...v0.20.0

Don't miss a new jni release

NewReleases is sending notifications on new releases.