I am trying to call the JNI function CallStaticVoidMethod
from rust. The jni-sys wrapper declares it as
pub CallStaticVoidMethod:
Option<unsafe extern "C" fn(env: *mut JNIEnv, cls: jclass, methodID: jmethodID, ...)>,
I would like to wrap this call in something safer, so I have created this method on my wrapper object:
pub fn call_static_void_method(&mut self, cls: jclass, method: jmethod, args: & Vec<jobject>)
{
let csvm;
unsafe {
csvm = (**self.env_ptr).CallStaticVoidMethod.expect("no implementation of CallStaticVoidMethod");
}
unsafe {
return csvm(self.env_ptr, cls, method, /*what here?*/);
}
}
How can I convert args:Vec<jobject>
so that I can provide the final arguments to the CallStaticVoidMethod
JNI function?