Module jni::objects

source ·
Expand description

Wrappers for object pointers returned from the JVM.

Structs

  • Auto-release wrapper for a mutable pointer to the elements of a JPrimitiveArray (such as JByteArray)
  • Auto-release wrapper for a mutable pointer to the elements of a JPrimitiveArray (such as JByteArray)
  • Auto-delete wrapper for local refs.
  • A global JVM reference. These are “pinned” by the garbage collector and are guaranteed to not get collected until released. Thus, this is allowed to outlive the JNIEnv that it came from and can be used in other threads.
  • Lifetime’d representation of a jobject that is an instance of the ByteBuffer Java class. Just a JObject wrapped in a new class.
  • Lifetime’d representation of a jclass. Just a JObject wrapped in a new class.
  • Wrapper around jfieldID that implements Send + Sync since method IDs are valid across threads (not tied to a JNIEnv).
  • Wrapper for JObjects that implement java/util/List. Provides methods to get, add, and remove elements.
  • An iterator over the keys and values in a java.util.List. See JList::iter for more information.
  • Wrapper for JObjects that implement java/util/Map. Provides methods to get and set entries and a way to iterate over key/value pairs.
  • An iterator over the keys and values in a map. See JMap::iter for more information.
  • Wrapper around jmethodID that implements Send + Sync since method IDs are valid across threads (not tied to a JNIEnv).
  • Wrapper around [sys::jobject] that adds a lifetime to ensure that the underlying JNI pointer won’t be accessible to safe Rust code if the object reference is released.
  • Lifetime’d representation of a jobjectArray which wraps a JObject reference
  • Lifetime’d representation of a jarray which wraps a JObject reference
  • Wrapper around jfieldID that implements Send + Sync since field IDs are valid across threads (not tied to a JNIEnv).
  • Wrapper around jmethodID that implements Send + Sync since method IDs are valid across threads (not tied to a JNIEnv).
  • Lifetime’d representation of a jstring. Just a JObject wrapped in a new class.
  • Lifetime’d representation of a jthrowable. Just a JObject wrapped in a new class.
  • A weak global JVM reference. These are global in scope like GlobalRef, and may outlive the JNIEnv they came from, but are not guaranteed to not get collected until released.

Enums

  • Rusty version of the JNI C jvalue enum. Used in Java method call arguments and returns.
  • ReleaseMode

Traits

  • Trait to access the raw jarray pointer for types that wrap an array reference
  • A sealed trait to define type array access/release for primitive JNI types

Type Definitions