jni-rs v0.20.0 Release Notes
Release Date: 2022-10-17 // 8 months ago-
โ Added
- 0๏ธโฃ
Default
trait implemented forJObject
,JString
,JClass
, andJByteBuffer
(#199) - ๐
Debug
trait implemented forJavaVM
,GlobalRef
,GlobalRefGuard
,JStaticMethodID
andReleaseMode
(#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
asunsafe
(#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 particularJNIEnv
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
andJStaticMethodID
implementSend
+Sync
and no longer has a lifetime parameter, making method IDs cacheable (with a documented 'Safety' note about ensuring they remain valid). (#346) - ๐
JFieldID
andJStaticFieldID
implementSend
+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 takejni:sys::jvalue
arguments to avoid allocating aVec
on each call to map + collectJValue
s assys:jvalue
s (#329) - ๐ท The
From
trait implementations convertingjni_sys
types likejobject
toJObject
have been replaced withunsafe
::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
andJNIEnv::take_rust_field
have been marked asunsafe
(#219)
- 0๏ธโฃ
Previous changes from v0.19.0
-
โ Added
AutoArray
and genericget_array_elements()
, along withget_<type>_array_elements
helpers. (#287)size()
method toAutoArray
andAutoPrimitiveArray
. (#278 / #287)discard()
method toAutoArray
andAutoPrimitiveArray
. (#275 / #287)
๐ Changed
- โ Removed AutoPrimitiveArray::commit(). (#290)
AutoByte/PrimitiveArray.commit()
now returnsResult
. (#275)- Removed methods get/release/commit_byte/primitive_array_{elements|critical}. (#281)
- Renamed methods get_auto_byte/long/primitive_array_{elements|critical} to get_byte/long/primitive_array_{elements|critical}. (#281)