r#"impl SwigForeignClass for Rc> { type PointedType = RefCell; fn jni_class() -> jclass { swig_jni_find_class!(FOREIGN_CLASS_BOO, "org/example/Boo") } fn jni_class_pointer_field() -> jfieldID { swig_jni_get_field_id!( FOREIGN_CLASS_BOO_MNATIVEOBJ_FIELD, FOREIGN_CLASS_BOO, "mNativeObj", "J" ) } fn box_object(this: Self) -> jlong { let this: *const RefCell = Rc::into_raw(this); this as jlong } fn unbox_object(x: jlong) -> Self { let x: *mut RefCell = unsafe { jlong_to_pointer::>(x).as_mut().unwrap() }; let x: Rc> = unsafe { Rc::from_raw(x) }; x } fn to_pointer(x: jlong) -> ::std::ptr::NonNull { let x: *mut RefCell = unsafe { jlong_to_pointer::>(x).as_mut().unwrap() }; ::std::ptr::NonNull::::new(x).unwrap() } }"#;