My understanding of invoking java from rust via the jni
crate involves a bit of boilerplate that looks like
je.call_method(self.rimuru, "shell2Pixels", "(II[B)V", &[
JValue::from(width),
JValue::from(height),
JValue::from(rgbs.as_obj()),
])?;
I am imagining that this could be improved using macros. Perhaps something like
java_call_method!(self.rimuru, "shell2Pixels", (), width, height, rgbs)?;
The macro would be responsible for building the signature string (II[B)V
from the types of the various arguments.
Does something like this already exist and I have not discovered it? I am not sure if it can be implemented using regular macros instead of procedural macros.