|
3 | 3 | // DO NOT EDIT
|
4 | 4 |
|
5 | 5 | use crate::ffi;
|
| 6 | +#[cfg(feature = "v2_84")] |
| 7 | +#[cfg_attr(docsrs, doc(cfg(feature = "v2_84")))] |
| 8 | +use crate::Icon; |
| 9 | +#[cfg(feature = "v2_84")] |
| 10 | +#[cfg_attr(docsrs, doc(cfg(feature = "v2_84")))] |
| 11 | +use glib::translate::*; |
6 | 12 |
|
7 | 13 | glib::wrapper! {
|
8 | 14 | #[derive(Debug)]
|
9 | 15 | pub struct UnixMountEntry(Boxed<ffi::GUnixMountEntry>);
|
10 | 16 |
|
11 | 17 | match fn {
|
12 |
| - copy => |ptr| glib::gobject_ffi::g_boxed_copy(ffi::g_unix_mount_entry_get_type(), ptr as *mut _) as *mut ffi::GUnixMountEntry, |
13 |
| - free => |ptr| glib::gobject_ffi::g_boxed_free(ffi::g_unix_mount_entry_get_type(), ptr as *mut _), |
| 18 | + copy => |ptr| ffi::g_unix_mount_entry_copy(mut_override(ptr)), |
| 19 | + free => |ptr| ffi::g_unix_mount_entry_free(ptr), |
14 | 20 | type_ => || ffi::g_unix_mount_entry_get_type(),
|
15 | 21 | }
|
16 | 22 | }
|
17 | 23 |
|
| 24 | +impl UnixMountEntry { |
| 25 | + #[cfg(feature = "v2_84")] |
| 26 | + #[cfg_attr(docsrs, doc(cfg(feature = "v2_84")))] |
| 27 | + #[doc(alias = "g_unix_mount_entry_compare")] |
| 28 | + fn compare(&mut self, mount2: &mut UnixMountEntry) -> i32 { |
| 29 | + unsafe { |
| 30 | + ffi::g_unix_mount_entry_compare(self.to_glib_none_mut().0, mount2.to_glib_none_mut().0) |
| 31 | + } |
| 32 | + } |
| 33 | + |
| 34 | + #[cfg(feature = "v2_84")] |
| 35 | + #[cfg_attr(docsrs, doc(cfg(feature = "v2_84")))] |
| 36 | + #[doc(alias = "g_unix_mount_entry_get_device_path")] |
| 37 | + #[doc(alias = "get_device_path")] |
| 38 | + pub fn device_path(&mut self) -> std::path::PathBuf { |
| 39 | + unsafe { |
| 40 | + from_glib_none(ffi::g_unix_mount_entry_get_device_path( |
| 41 | + self.to_glib_none_mut().0, |
| 42 | + )) |
| 43 | + } |
| 44 | + } |
| 45 | + |
| 46 | + #[cfg(feature = "v2_84")] |
| 47 | + #[cfg_attr(docsrs, doc(cfg(feature = "v2_84")))] |
| 48 | + #[doc(alias = "g_unix_mount_entry_get_fs_type")] |
| 49 | + #[doc(alias = "get_fs_type")] |
| 50 | + pub fn fs_type(&mut self) -> glib::GString { |
| 51 | + unsafe { |
| 52 | + from_glib_none(ffi::g_unix_mount_entry_get_fs_type( |
| 53 | + self.to_glib_none_mut().0, |
| 54 | + )) |
| 55 | + } |
| 56 | + } |
| 57 | + |
| 58 | + #[cfg(feature = "v2_84")] |
| 59 | + #[cfg_attr(docsrs, doc(cfg(feature = "v2_84")))] |
| 60 | + #[doc(alias = "g_unix_mount_entry_get_mount_path")] |
| 61 | + #[doc(alias = "get_mount_path")] |
| 62 | + pub fn mount_path(&mut self) -> std::path::PathBuf { |
| 63 | + unsafe { |
| 64 | + from_glib_none(ffi::g_unix_mount_entry_get_mount_path( |
| 65 | + self.to_glib_none_mut().0, |
| 66 | + )) |
| 67 | + } |
| 68 | + } |
| 69 | + |
| 70 | + #[cfg(feature = "v2_84")] |
| 71 | + #[cfg_attr(docsrs, doc(cfg(feature = "v2_84")))] |
| 72 | + #[doc(alias = "g_unix_mount_entry_get_options")] |
| 73 | + #[doc(alias = "get_options")] |
| 74 | + pub fn options(&mut self) -> Option<glib::GString> { |
| 75 | + unsafe { |
| 76 | + from_glib_none(ffi::g_unix_mount_entry_get_options( |
| 77 | + self.to_glib_none_mut().0, |
| 78 | + )) |
| 79 | + } |
| 80 | + } |
| 81 | + |
| 82 | + #[cfg(feature = "v2_84")] |
| 83 | + #[cfg_attr(docsrs, doc(cfg(feature = "v2_84")))] |
| 84 | + #[doc(alias = "g_unix_mount_entry_get_root_path")] |
| 85 | + #[doc(alias = "get_root_path")] |
| 86 | + pub fn root_path(&mut self) -> Option<glib::GString> { |
| 87 | + unsafe { |
| 88 | + from_glib_none(ffi::g_unix_mount_entry_get_root_path( |
| 89 | + self.to_glib_none_mut().0, |
| 90 | + )) |
| 91 | + } |
| 92 | + } |
| 93 | + |
| 94 | + #[cfg(feature = "v2_84")] |
| 95 | + #[cfg_attr(docsrs, doc(cfg(feature = "v2_84")))] |
| 96 | + #[doc(alias = "g_unix_mount_entry_guess_can_eject")] |
| 97 | + pub fn guess_can_eject(&mut self) -> bool { |
| 98 | + unsafe { |
| 99 | + from_glib(ffi::g_unix_mount_entry_guess_can_eject( |
| 100 | + self.to_glib_none_mut().0, |
| 101 | + )) |
| 102 | + } |
| 103 | + } |
| 104 | + |
| 105 | + #[cfg(feature = "v2_84")] |
| 106 | + #[cfg_attr(docsrs, doc(cfg(feature = "v2_84")))] |
| 107 | + #[doc(alias = "g_unix_mount_entry_guess_icon")] |
| 108 | + pub fn guess_icon(&mut self) -> Icon { |
| 109 | + unsafe { |
| 110 | + from_glib_full(ffi::g_unix_mount_entry_guess_icon( |
| 111 | + self.to_glib_none_mut().0, |
| 112 | + )) |
| 113 | + } |
| 114 | + } |
| 115 | + |
| 116 | + #[cfg(feature = "v2_84")] |
| 117 | + #[cfg_attr(docsrs, doc(cfg(feature = "v2_84")))] |
| 118 | + #[doc(alias = "g_unix_mount_entry_guess_name")] |
| 119 | + pub fn guess_name(&mut self) -> glib::GString { |
| 120 | + unsafe { |
| 121 | + from_glib_full(ffi::g_unix_mount_entry_guess_name( |
| 122 | + self.to_glib_none_mut().0, |
| 123 | + )) |
| 124 | + } |
| 125 | + } |
| 126 | + |
| 127 | + #[cfg(feature = "v2_84")] |
| 128 | + #[cfg_attr(docsrs, doc(cfg(feature = "v2_84")))] |
| 129 | + #[doc(alias = "g_unix_mount_entry_guess_should_display")] |
| 130 | + pub fn guess_should_display(&mut self) -> bool { |
| 131 | + unsafe { |
| 132 | + from_glib(ffi::g_unix_mount_entry_guess_should_display( |
| 133 | + self.to_glib_none_mut().0, |
| 134 | + )) |
| 135 | + } |
| 136 | + } |
| 137 | + |
| 138 | + #[cfg(feature = "v2_84")] |
| 139 | + #[cfg_attr(docsrs, doc(cfg(feature = "v2_84")))] |
| 140 | + #[doc(alias = "g_unix_mount_entry_guess_symbolic_icon")] |
| 141 | + pub fn guess_symbolic_icon(&mut self) -> Icon { |
| 142 | + unsafe { |
| 143 | + from_glib_full(ffi::g_unix_mount_entry_guess_symbolic_icon( |
| 144 | + self.to_glib_none_mut().0, |
| 145 | + )) |
| 146 | + } |
| 147 | + } |
| 148 | + |
| 149 | + #[cfg(feature = "v2_84")] |
| 150 | + #[cfg_attr(docsrs, doc(cfg(feature = "v2_84")))] |
| 151 | + #[doc(alias = "g_unix_mount_entry_is_readonly")] |
| 152 | + pub fn is_readonly(&mut self) -> bool { |
| 153 | + unsafe { |
| 154 | + from_glib(ffi::g_unix_mount_entry_is_readonly( |
| 155 | + self.to_glib_none_mut().0, |
| 156 | + )) |
| 157 | + } |
| 158 | + } |
| 159 | + |
| 160 | + #[cfg(feature = "v2_84")] |
| 161 | + #[cfg_attr(docsrs, doc(cfg(feature = "v2_84")))] |
| 162 | + #[doc(alias = "g_unix_mount_entry_is_system_internal")] |
| 163 | + pub fn is_system_internal(&mut self) -> bool { |
| 164 | + unsafe { |
| 165 | + from_glib(ffi::g_unix_mount_entry_is_system_internal( |
| 166 | + self.to_glib_none_mut().0, |
| 167 | + )) |
| 168 | + } |
| 169 | + } |
| 170 | + |
| 171 | + #[cfg(feature = "v2_84")] |
| 172 | + #[cfg_attr(docsrs, doc(cfg(feature = "v2_84")))] |
| 173 | + #[doc(alias = "g_unix_mount_entry_at")] |
| 174 | + pub fn at(mount_path: impl AsRef<std::path::Path>) -> (Option<UnixMountEntry>, u64) { |
| 175 | + unsafe { |
| 176 | + let mut time_read = std::mem::MaybeUninit::uninit(); |
| 177 | + let ret = from_glib_full(ffi::g_unix_mount_entry_at( |
| 178 | + mount_path.as_ref().to_glib_none().0, |
| 179 | + time_read.as_mut_ptr(), |
| 180 | + )); |
| 181 | + (ret, time_read.assume_init()) |
| 182 | + } |
| 183 | + } |
| 184 | + |
| 185 | + #[cfg(feature = "v2_84")] |
| 186 | + #[cfg_attr(docsrs, doc(cfg(feature = "v2_84")))] |
| 187 | + #[doc(alias = "g_unix_mount_entry_for")] |
| 188 | + #[doc(alias = "for")] |
| 189 | + pub fn for_(file_path: impl AsRef<std::path::Path>) -> (Option<UnixMountEntry>, u64) { |
| 190 | + unsafe { |
| 191 | + let mut time_read = std::mem::MaybeUninit::uninit(); |
| 192 | + let ret = from_glib_full(ffi::g_unix_mount_entry_for( |
| 193 | + file_path.as_ref().to_glib_none().0, |
| 194 | + time_read.as_mut_ptr(), |
| 195 | + )); |
| 196 | + (ret, time_read.assume_init()) |
| 197 | + } |
| 198 | + } |
| 199 | +} |
| 200 | + |
| 201 | +#[cfg(feature = "v2_84")] |
| 202 | +#[cfg_attr(docsrs, doc(cfg(feature = "v2_84")))] |
| 203 | +impl PartialEq for UnixMountEntry { |
| 204 | + #[inline] |
| 205 | + fn eq(&self, other: &Self) -> bool { |
| 206 | + self.compare(other) == 0 |
| 207 | + } |
| 208 | +} |
| 209 | + |
| 210 | +impl Eq for UnixMountEntry {} |
| 211 | + |
| 212 | +#[cfg(feature = "v2_84")] |
| 213 | +#[cfg_attr(docsrs, doc(cfg(feature = "v2_84")))] |
| 214 | +impl PartialOrd for UnixMountEntry { |
| 215 | + #[inline] |
| 216 | + fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> { |
| 217 | + Some(self.cmp(other)) |
| 218 | + } |
| 219 | +} |
| 220 | + |
| 221 | +impl Ord for UnixMountEntry { |
| 222 | + #[inline] |
| 223 | + fn cmp(&self, other: &Self) -> std::cmp::Ordering { |
| 224 | + self.compare(other).cmp(&0) |
| 225 | + } |
| 226 | +} |
| 227 | + |
18 | 228 | unsafe impl Send for UnixMountEntry {}
|
19 | 229 | unsafe impl Sync for UnixMountEntry {}
|
0 commit comments