endpoint_sec/event/
event_btm_launch_item_remove.rs1use endpoint_sec_sys::es_event_btm_launch_item_remove_t;
4
5use crate::{AuditToken, BtmLaunchItem, Process};
6
7#[doc(alias = "es_event_btm_launch_item_add_t")]
9pub struct EventBtmLaunchItemRemove<'a> {
10 pub(crate) raw: &'a es_event_btm_launch_item_remove_t,
12 pub(crate) version: u32,
14}
15
16impl<'a> EventBtmLaunchItemRemove<'a> {
17 #[inline(always)]
20 pub fn instigator(&self) -> Option<Process<'a>> {
21 let process = unsafe { self.raw.instigator()? };
23 Some(Process::new(process, self.version))
24 }
25
26 pub fn instigator_token(&self) -> Option<AuditToken> {
28 #[cfg(feature = "macos_15_0_0")]
29 if self.version >= 8 {
30 let token = unsafe { self.raw.instigator_token() };
32 return token.map(|v| AuditToken(*v));
33 }
34
35 self.instigator().map(|v| v.audit_token())
37 }
38
39 #[inline(always)]
41 pub fn app(&self) -> Option<Process<'a>> {
42 let process = unsafe { self.raw.app()? };
44 Some(Process::new(process, self.version))
45 }
46
47 pub fn app_token(&self) -> Option<AuditToken> {
49 #[cfg(feature = "macos_15_0_0")]
50 if self.version >= 8 {
51 let token = unsafe { self.raw.app_token() };
53 return token.map(|v| AuditToken(*v));
54 }
55
56 self.app().map(|v| v.audit_token())
58 }
59
60 #[inline(always)]
62 pub fn item(&self) -> BtmLaunchItem<'a> {
63 BtmLaunchItem::new(unsafe { self.raw.item() })
65 }
66}
67
68unsafe impl Send for EventBtmLaunchItemRemove<'_> {}
70unsafe impl Sync for EventBtmLaunchItemRemove<'_> {}
72
73impl_debug_eq_hash_with_functions!(EventBtmLaunchItemRemove<'a>; instigator, instigator_token, app, app_token, item);