Expand description
Common glue code between Rust and JNI, used in autogenerated jni-bindgen glue code.
See also the Android JNI tips documentation as well as the Java Native Interface Specification.
Structs§
- Argument
- FFI: Use Argument<java::lang::Object> instead of jobject. This represents a (null?) function argument.
- Boolean
Array - A PrimitiveArray implementation.
- Byte
Array - A PrimitiveArray implementation.
- Char
Array - A PrimitiveArray implementation.
- Double
Array - A PrimitiveArray implementation.
- Env
- FFI: Use &Env instead of *const JNIEnv. This represents a per-thread Java exection environment.
- Float
Array - A PrimitiveArray implementation.
- Global
- A Global, non-null, reference to a Java object (+ &VM).
- IntArray
- A PrimitiveArray implementation.
- Local
- A Local, non-null, reference to a Java object (+ &Env) limited to the current thread/stack.
- Long
Array - A PrimitiveArray implementation.
- Object
Array - A Java Array of reference types (classes, interfaces, other arrays, etc.)
- Object
Array Iter - Ref
- A non-null, reference to a Java object (+ &Env). This may refer to a Local, Global, local Argument, etc.
- Short
Array - A PrimitiveArray implementation.
- String
Chars - Represents an env.GetStringChars + env.GetStringLength query. Will automatically env.ReleaseStringChars when dropped.
- VM
- FFI: Use &VM instead of *const JavaVM. This represents a global, process-wide Java exection environment.
- jchar
- Represents a Java “UTF16” code unit. This is not guaranteed to actually be a valid code unit, and should be treated much like wchar_t is treated by Rust - encoded possibly as WTF8 rather than UTF8, laden with error checking when converting to Rust character/string types, etc.
Traits§
- JniType
- JNI bindings rely on this type being accurate.
- Primitive
Array - A Java Array of some POD-like type such as bool, jbyte, jchar, jshort, jint, jlong, jfloat, or jdouble.
- Throwable
Type - A marker type indicating this is a valid exception type that all exceptions thrown by java should be compatible with
Functions§
- JNI_
OnLoad ⚠ - Do not call! Automatically invoked by the JVM. See “unsafe-manual-jni-load-unload” to override this behavior.
- JNI_
OnUnload - Do not call! Automatically invoked by the JVM. See “unsafe-manual-jni-load-unload” to override this behavior.
Type Aliases§
- Argument
Ref - A Local, non-null, reference to a Java object (+ &Env).
- Global
Ref - A Global, non-null, reference to a Java object (+ &Env).