Expand description
Runtime half of the JNI binding generator.
prebindgen’s lang::JniGen adapter generates JNI binding code at
build time; the helpers in this crate are what that generated code
calls at run time. A shipped binding library depends on this crate,
not on the generator.
Structs§
- Cached
Iface Method - A
(pinned interface class, method ID)pair resolved once per process. Declare asstatic; the embeddedOnceLockhandles the one-time resolution race (both winners produce equivalent values).
Enums§
- JniBinding
Error - Framework error type for the JNI binding’s error channel.
Tis the function’s domain error (()for the E-agnostic framework converters, whose failures are alwaysSelf::JniError).
Functions§
- box_
jboolean - Box a
jni::sys::jbooleanintojava/lang/Booleanvia cachedvalueOf. - box_
jbyte - Box a
jni::sys::jbyteintojava/lang/Bytevia cachedvalueOf. - box_
jchar - Box a
jni::sys::jcharintojava/lang/Charactervia cachedvalueOf. - box_
jdouble - Box a
jni::sys::jdoubleintojava/lang/Doublevia cachedvalueOf. - box_
jfloat - Box a
jni::sys::jfloatintojava/lang/Floatvia cachedvalueOf. - box_
jint - Box a
jni::sys::jintintojava/lang/Integervia cachedvalueOf. - box_
jlong - Box a
jni::sys::jlongintojava/lang/Longvia cachedvalueOf. - box_
jshort - Box a
jni::sys::jshortintojava/lang/Shortvia cachedvalueOf. - decode_
byte_ array - Converts a JNI
JByteArrayinto a RustVec<u8>. - decode_
string - Converts a JString into a Rust String.
- encode_
byte_ array - Converts a Rust byte slice into a JNI
JByteArray. - encode_
string - Converts a Rust string-like value into a JNI
JString. - null_
byte_ array - Returns a null JNI byte-array handle.
- null_
string - Returns a null JNI string handle.