uni_tmp_jni/wrapper/objects/
jclass.rs1use crate::{
2 objects::JObject,
3 sys::{jclass, jobject},
4};
5
6#[repr(transparent)]
9#[derive(Clone, Copy, Debug)]
10pub struct JClass<'a>(JObject<'a>);
11
12impl<'a> From<jclass> for JClass<'a> {
13 fn from(other: jclass) -> Self {
14 JClass(From::from(other as jobject))
15 }
16}
17
18impl<'a> ::std::ops::Deref for JClass<'a> {
19 type Target = JObject<'a>;
20
21 fn deref(&self) -> &Self::Target {
22 &self.0
23 }
24}
25
26impl<'a> From<JClass<'a>> for JObject<'a> {
27 fn from(other: JClass) -> JObject {
28 other.0
29 }
30}
31
32impl<'a> From<JObject<'a>> for JClass<'a> {
34 fn from(other: JObject) -> JClass {
35 (other.into_inner() as jclass).into()
36 }
37}