gio/unix_mount_point.rs
1// Take a look at the license at the top of the repository in the LICENSE file.
2
3use std::mem;
4
5use glib::translate::*;
6
7use crate::{ffi, UnixMountPoint};
8
9impl UnixMountPoint {
10 #[cfg(unix)]
11 #[doc(alias = "g_unix_mount_points_get")]
12 #[doc(alias = "get_mount_points")]
13 pub fn mount_points() -> (Vec<UnixMountPoint>, u64) {
14 unsafe {
15 let mut time_read = mem::MaybeUninit::uninit();
16 let ret = FromGlibPtrContainer::from_glib_full(ffi::g_unix_mount_points_get(
17 time_read.as_mut_ptr(),
18 ));
19 let time_read = time_read.assume_init();
20 (ret, time_read)
21 }
22 }
23
24 #[doc(alias = "g_unix_mount_points_changed_since")]
25 pub fn is_changed_since(time: u64) -> bool {
26 unsafe { from_glib(ffi::g_unix_mount_points_changed_since(time)) }
27 }
28}