jvmti_rs/wrapper/objects/
jraw_monitor_id.rs

1use crate::sys::jrawMonitorID;
2use std::marker::PhantomData;
3
4#[repr(transparent)]
5#[derive(Clone, Copy, Debug)]
6pub struct JRawMonitorID<'a> {
7    internal: jrawMonitorID,
8    lifetime: PhantomData<&'a ()>,
9}
10
11impl<'a> From<jrawMonitorID> for JRawMonitorID<'a> {
12    fn from(monitor_id: jrawMonitorID) -> Self {
13        JRawMonitorID {
14            internal: monitor_id,
15            lifetime: PhantomData,
16        }
17    }
18}
19
20impl<'a> From<JRawMonitorID<'a>> for jrawMonitorID {
21    fn from(monitor_id: JRawMonitorID<'a>) -> Self {
22        monitor_id.internal
23    }
24}
25
26impl<'a> From<&JRawMonitorID<'a>> for jrawMonitorID {
27    fn from(monitor_id: &JRawMonitorID<'a>) -> Self {
28        monitor_id.internal
29    }
30}
31
32impl<'a> ::std::ops::Deref for JRawMonitorID<'a> {
33    type Target = jrawMonitorID;
34
35    fn deref(&self) -> &Self::Target {
36        &self.internal
37    }
38}