Translating Java method signatures to Rust

The java_package macro translates Java methods into Rust methods. The method argument types are translated as follows:

Java argument typeRust argument type
byteimpl duchess::IntoScalar<i8>
shortimpl duchess::IntoScalar<i16>
intimpl duchess::IntoScalar<i32>
longimpl duchess::IntoScalar<i64>
Java object type Jimpl duchess::IntoJava<J>
e.g., java.lang.Stringimpl duchess::IntoJava<java::lang::String>

The Rust version of the Java method will return one of the following traits. These are not the actual Rust value, but rather the JVM operation that will yield the value when executed:

Java return typeRust return type
voidimpl duchess::VoidMethod
byteimpl duchess::ScalarMethod<i8>
...impl duchess::ScalarMethod<...>
longimpl duchess::ScalarMethod<i64>
Java object type Jimpl duchess::JavaMethod<J>
e.g., java.lang.Stringimpl duchess::JavaMethod<java::lang::String>