Skip to main content

Module codegen_java

Module codegen_java 

Source
Expand description

Java: the JNI wrapper (the original classes’ static methods over the Rust library), a small JSON codec with no dependencies, and the reflection driver for record, diff and bench.

Constants§

DRIVER_JAVA
rustanything/RustAnythingDriver.java: calls static methods by name for record, diff and bench.
ERROR_JAVA
rustanything/RustAnythingError.java: the error the Rust side throws, turned into the real exception type in Java.
JSON_JAVA
rustanything/RustAnythingJson.java: JSON text to Java values and back, conversion to declared generic types, and the markers for floats JSON cannot carry.
WIRE_JAVA
rustanything/RustAnythingWire.java: the Java half of the binary wire.

Functions§

native_class
The native class: loads the Rust library and calls the dispatcher.
shadows
Shadow classes, <Class>Shadow beside each original class: the same static methods, running the original and the Rust port, returning the original’s result and counting mismatches. -Drust-anything.mode=old runs the original only, new the port only.
targets
{ name: [class, method] } for the driver.
typed_rs
Typed JNI functions for lib.rs, appended after the JSON dispatcher.
wire_rs
Rust code of every wire export, for lib.rs.
wrappers
The wrapper classes: (path, source) for each class of the unit with ported methods.