Skip to main content

Crate prebindgen_jni_runtime

Crate prebindgen_jni_runtime 

Source
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§

CachedIfaceMethod
A (pinned interface class, method ID) pair resolved once per process. Declare as static; the embedded OnceLock handles the one-time resolution race (both winners produce equivalent values).

Enums§

JniBindingError
Framework error type for the JNI binding’s error channel. T is the function’s domain error (() for the E-agnostic framework converters, whose failures are always Self::JniError).

Functions§

box_jboolean
Box a jni::sys::jboolean into java/lang/Boolean via cached valueOf.
box_jbyte
Box a jni::sys::jbyte into java/lang/Byte via cached valueOf.
box_jchar
Box a jni::sys::jchar into java/lang/Character via cached valueOf.
box_jdouble
Box a jni::sys::jdouble into java/lang/Double via cached valueOf.
box_jfloat
Box a jni::sys::jfloat into java/lang/Float via cached valueOf.
box_jint
Box a jni::sys::jint into java/lang/Integer via cached valueOf.
box_jlong
Box a jni::sys::jlong into java/lang/Long via cached valueOf.
box_jshort
Box a jni::sys::jshort into java/lang/Short via cached valueOf.
decode_byte_array
Converts a JNI JByteArray into a Rust Vec<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.