jvmti_rs/wrapper/objects/
jclass_loader.rs1use jni_sys::jobject;
2use std::marker::PhantomData;
3
4#[repr(transparent)]
5#[derive(Clone, Copy, Debug)]
6pub struct JClassLoader<'a> {
7 internal: jobject,
8 lifetime: PhantomData<&'a ()>,
9}
10
11impl<'a> From<jobject> for JClassLoader<'a> {
12 fn from(location: jobject) -> Self {
13 JClassLoader {
14 internal: location,
15 lifetime: PhantomData,
16 }
17 }
18}
19
20impl<'a> From<JClassLoader<'a>> for jobject {
21 fn from(location: JClassLoader<'a>) -> Self {
22 location.internal
23 }
24}
25
26impl<'a> ::std::ops::Deref for JClassLoader<'a> {
27 type Target = jobject;
28
29 fn deref(&self) -> &Self::Target {
30 &self.internal
31 }
32}