endpoint_sec/event/
event_remount.rs

1//! [`EventRemount`]
2
3use endpoint_sec_sys::{es_event_remount_t, statfs};
4
5/// Remount a file system event.
6#[doc(alias = "es_event_remount_t")]
7pub struct EventRemount<'a> {
8    /// Raw event
9    pub(crate) raw: &'a es_event_remount_t,
10}
11
12impl<'a> EventRemount<'a> {
13    ///  The file system stats for the file system being mounted.
14    #[inline(always)]
15    pub fn statfs(&self) -> &'a statfs {
16        // Safety: 'a tied to self, object obtained through ES
17        unsafe { self.raw.statfs() }
18    }
19}
20
21// Safety: safe to send across threads: does not contain any interior mutability nor depend on current thread state
22unsafe impl Send for EventRemount<'_> {}
23// Safety: safe to share across threads: does not contain any interior mutability nor depend on current thread state
24unsafe impl Sync for EventRemount<'_> {}
25
26impl_debug_eq_hash_with_functions!(EventRemount<'a>; statfs);