Expand description
Common glue code between Rust and JNI, used in auto-generated java-oxide glue code.
See also the Android JNI tips documentation as well as the Java Native Interface Specification.
Just like jni-rs, thread safety of accessing Java objects are not guaranteed, unless they are thread-safe by themselves.
Re-exports§
pub use ::jni_sys as sys;
Structs§
- Arg
- FFI: Use Arg<java::lang::Object> instead of
jobject. This represents a (null?) function argument. - Cast
Error - Error returned on failed
.cast().` - Env
- FFI: Use Env instead of
*const JNIEnv. This represents a per-thread Java exection environment. - Global
- A Global, non-null, reference to a Java object (+ VM).
- Local
- A Local, non-null, reference to a Java object (+ Env) limited to the current thread/stack.
- Monitor
- A borrowed Ref of a Java object locked with the JNI monitor mechanism, providing limited thread safety.
- Null
- Represents a Java
nullvalue. - Object
Array - A Java Array of reference types (classes, interfaces, other arrays, etc.)
- Object
Array Iter - An iterator over object items of an ObjectArray. Local references of object items will be created automatically.
- Ref
- A non-null, reference to a Java object (+ Env). This may refer to a Local, Global, local Arg, etc.
- Return
- FFI: Use Return<java::lang::Object> instead of
jobject. This represents a (null?) JNI function call return value. - String
Chars - Represents a JNI
GetStringChars+GetStringLengthquery. It will callReleaseStringCharsautomatically when dropped. - VM
- FFI: Use &VM instead of
*const JavaVM. This represents a global, process-wide Java exection environment.
Enums§
- Boolean
Array - A PrimitiveArray implementation.
- Byte
Array - A PrimitiveArray implementation.
- Char
Array - A PrimitiveArray implementation.
- Double
Array - A PrimitiveArray implementation.
- Float
Array - A PrimitiveArray implementation.
- IntArray
- A PrimitiveArray implementation.
- Long
Array - A PrimitiveArray implementation.
- Short
Array - A PrimitiveArray implementation.
Traits§
- AsArg
- A marker trait indicating this is a valid JNI reference type for Java method argument
type
T, this can be null. - Assignable
To - Marker trait indicating
Selfcan be assigned toT. - Java
Debug - A trait similar to
Debug. Currently it is implemented byThrowablein generated bindings. - Java
Display - A trait similar to
Display. - 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, orjdouble. - Throwable
Type - A marker type indicating this is a valid exception type that all exceptions thrown by java should be compatible with