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

Method from_jobject_with_global_ref

rust/src/api/instance.rs:71–81  ·  view source on GitHub ↗
(obj: jobject)

Source from the content-addressed store, hash-verified

69 }
70
71 pub fn from_jobject_with_global_ref(obj: jobject) -> errors::Result<Instance> {
72 let _jvm = cache::get_thread_local_env().map_err(|_| Jvm::attach_thread());
73
74 let global =
75 jni_utils::create_global_ref_from_local_ref(obj, cache::get_thread_local_env()?)?;
76 Ok(Instance {
77 jinstance: global,
78 class_name: cache::UNKNOWN_FOR_RUST.to_string(),
79 skip_deleting_jobject: false,
80 })
81 }
82
83 /// Creates a weak reference of this Instance.
84 fn _weak_ref(&self) -> errors::Result<Instance> {

Callers

nothing calls this directly

Calls 3

get_thread_local_envFunction · 0.85
to_stringMethod · 0.80

Tested by

no test coverage detected