MCPcopy Create free account
hub / github.com/astonbitecode/j4rs / as_java_ptr_with_local_ref

Method as_java_ptr_with_local_ref

rust/src/api/invocation_arg.rs:217–229  ·  view source on GitHub ↗

Creates a `jobject` from this InvocationArg. The jobject contains a local reference.

(&self, jni_env: *mut JNIEnv)

Source from the content-addressed store, hash-verified

215
216 /// Creates a `jobject` from this InvocationArg. The jobject contains a local reference.
217 pub fn as_java_ptr_with_local_ref(&self, jni_env: *mut JNIEnv) -> errors::Result<jobject> {
218 match self {
219 _s @ &InvocationArg::Java { .. } => {
220 jni_utils::invocation_arg_jobject_from_java(self, jni_env, false)
221 }
222 _s @ &InvocationArg::Rust { .. } => {
223 jni_utils::invocation_arg_jobject_from_rust_serialized(self, jni_env, false)
224 }
225 _s @ &InvocationArg::RustBasic { .. } => {
226 jni_utils::invocation_arg_jobject_from_rust_basic(self, jni_env, false)
227 }
228 }
229 }
230
231 /// Consumes this invocation arg and returns its Instance
232 pub fn instance(self) -> errors::Result<Instance> {

Callers 1

try_fromMethod · 0.80

Tested by

no test coverage detected