jvmti_rs/wrapper/enums/
visit.rs1use crate::sys;
2
3#[derive(Debug)]
4pub enum JvmtiVisit {
5 Objects,
6 Abort,
7 Unsupported(sys::jvmtiVisit),
8}
9
10
11impl From<sys::jvmtiVisit> for JvmtiVisit {
12 fn from(value: sys::jvmtiVisit) -> Self {
13 match value {
14 sys::JVMTI_VISIT_OBJECTS => JvmtiVisit::Objects,
15 sys::JVMTI_VISIT_ABORT => JvmtiVisit::Abort,
16 _ => JvmtiVisit::Unsupported(value)
17 }
18 }
19}
20
21impl From<JvmtiVisit> for sys::jvmtiVisit {
22 fn from(value: JvmtiVisit) -> Self {
23 match value {
24 JvmtiVisit::Objects => sys::JVMTI_VISIT_OBJECTS,
25 JvmtiVisit::Abort => sys::JVMTI_VISIT_ABORT,
26 _ => sys::JVMTI_CONSTANT_UNSUPPORTED,
27 }
28 }
29}