1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
use jni::objects::{GlobalRef, JObject}; use super::VM; pub struct Reference { pub(crate) global_ref: GlobalRef, pub(crate) vm: VM, } impl Reference { pub fn as_object(&self) -> JObject { self.global_ref.as_obj() } pub fn vm(&self) -> &VM { &self.vm } } impl Clone for Reference { fn clone(&self) -> Self { Reference { global_ref: self.global_ref.clone(), vm: self.vm.internal_clone(), } } }