Skip to content

Commit 25e9681

Browse files
committed
gio: Clean up and autogenerate UnixMountEntry bindings
1 parent 500fc7b commit 25e9681

File tree

6 files changed

+234
-265
lines changed

6 files changed

+234
-265
lines changed

gio/Gir.toml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1565,6 +1565,32 @@ concurrency = "send+sync"
15651565
cfg_condition = "unix"
15661566
[[object.derive]]
15671567
name = "Debug"
1568+
[[object.function]]
1569+
pattern = "compare|get_device_path|get_fs_type|get_mount_path|guess_can_eject|guess_name|guess_icon|guess_should_display|guess_symbolic_icon|is_readonly|is_system_internal"
1570+
version = "2.0"
1571+
[[object.function.parameter]]
1572+
pattern = ".+"
1573+
const = true
1574+
[[object.function]]
1575+
name = "get_options"
1576+
version = "2.58"
1577+
[[object.function.parameter]]
1578+
pattern = ".+"
1579+
const = true
1580+
[[object.function]]
1581+
name = "get_root_path"
1582+
version = "2.60"
1583+
[[object.function.parameter]]
1584+
pattern = ".+"
1585+
const = true
1586+
[[object.function]]
1587+
name = "at"
1588+
version = "2.0"
1589+
rename = "for_mount_path"
1590+
[[object.function]]
1591+
name = "for"
1592+
version = "2.0"
1593+
rename = "for_file_path"
15681594

15691595
[[object]]
15701596
name = "Gio.UnixMountPoint"

gio/src/auto/unix_mount_entry.rs

Lines changed: 63 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,7 @@
22
// from gir-files (https://github.com/gtk-rs/gir-files)
33
// DO NOT EDIT
44

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")))]
5+
use crate::{ffi, Icon};
116
use glib::translate::*;
127

138
glib::wrapper! {
@@ -22,156 +17,138 @@ glib::wrapper! {
2217
}
2318

2419
impl UnixMountEntry {
25-
#[cfg(feature = "v2_84")]
26-
#[cfg_attr(docsrs, doc(cfg(feature = "v2_84")))]
2720
#[doc(alias = "g_unix_mount_entry_compare")]
28-
fn compare(&mut self, mount2: &mut UnixMountEntry) -> i32 {
21+
fn compare(&self, mount2: &UnixMountEntry) -> i32 {
2922
unsafe {
30-
ffi::g_unix_mount_entry_compare(self.to_glib_none_mut().0, mount2.to_glib_none_mut().0)
23+
ffi::g_unix_mount_entry_compare(
24+
mut_override(self.to_glib_none().0),
25+
mut_override(mount2.to_glib_none().0),
26+
)
3127
}
3228
}
3329

34-
#[cfg(feature = "v2_84")]
35-
#[cfg_attr(docsrs, doc(cfg(feature = "v2_84")))]
3630
#[doc(alias = "g_unix_mount_entry_get_device_path")]
3731
#[doc(alias = "get_device_path")]
38-
pub fn device_path(&mut self) -> std::path::PathBuf {
32+
pub fn device_path(&self) -> std::path::PathBuf {
3933
unsafe {
40-
from_glib_none(ffi::g_unix_mount_entry_get_device_path(
41-
self.to_glib_none_mut().0,
42-
))
34+
from_glib_none(ffi::g_unix_mount_entry_get_device_path(mut_override(
35+
self.to_glib_none().0,
36+
)))
4337
}
4438
}
4539

46-
#[cfg(feature = "v2_84")]
47-
#[cfg_attr(docsrs, doc(cfg(feature = "v2_84")))]
4840
#[doc(alias = "g_unix_mount_entry_get_fs_type")]
4941
#[doc(alias = "get_fs_type")]
50-
pub fn fs_type(&mut self) -> glib::GString {
42+
pub fn fs_type(&self) -> glib::GString {
5143
unsafe {
52-
from_glib_none(ffi::g_unix_mount_entry_get_fs_type(
53-
self.to_glib_none_mut().0,
54-
))
44+
from_glib_none(ffi::g_unix_mount_entry_get_fs_type(mut_override(
45+
self.to_glib_none().0,
46+
)))
5547
}
5648
}
5749

58-
#[cfg(feature = "v2_84")]
59-
#[cfg_attr(docsrs, doc(cfg(feature = "v2_84")))]
6050
#[doc(alias = "g_unix_mount_entry_get_mount_path")]
6151
#[doc(alias = "get_mount_path")]
62-
pub fn mount_path(&mut self) -> std::path::PathBuf {
52+
pub fn mount_path(&self) -> std::path::PathBuf {
6353
unsafe {
64-
from_glib_none(ffi::g_unix_mount_entry_get_mount_path(
65-
self.to_glib_none_mut().0,
66-
))
54+
from_glib_none(ffi::g_unix_mount_entry_get_mount_path(mut_override(
55+
self.to_glib_none().0,
56+
)))
6757
}
6858
}
6959

70-
#[cfg(feature = "v2_84")]
71-
#[cfg_attr(docsrs, doc(cfg(feature = "v2_84")))]
60+
#[cfg(feature = "v2_58")]
61+
#[cfg_attr(docsrs, doc(cfg(feature = "v2_58")))]
7262
#[doc(alias = "g_unix_mount_entry_get_options")]
7363
#[doc(alias = "get_options")]
74-
pub fn options(&mut self) -> Option<glib::GString> {
64+
pub fn options(&self) -> Option<glib::GString> {
7565
unsafe {
76-
from_glib_none(ffi::g_unix_mount_entry_get_options(
77-
self.to_glib_none_mut().0,
78-
))
66+
from_glib_none(ffi::g_unix_mount_entry_get_options(mut_override(
67+
self.to_glib_none().0,
68+
)))
7969
}
8070
}
8171

82-
#[cfg(feature = "v2_84")]
83-
#[cfg_attr(docsrs, doc(cfg(feature = "v2_84")))]
72+
#[cfg(feature = "v2_60")]
73+
#[cfg_attr(docsrs, doc(cfg(feature = "v2_60")))]
8474
#[doc(alias = "g_unix_mount_entry_get_root_path")]
8575
#[doc(alias = "get_root_path")]
86-
pub fn root_path(&mut self) -> Option<glib::GString> {
76+
pub fn root_path(&self) -> Option<glib::GString> {
8777
unsafe {
88-
from_glib_none(ffi::g_unix_mount_entry_get_root_path(
89-
self.to_glib_none_mut().0,
90-
))
78+
from_glib_none(ffi::g_unix_mount_entry_get_root_path(mut_override(
79+
self.to_glib_none().0,
80+
)))
9181
}
9282
}
9383

94-
#[cfg(feature = "v2_84")]
95-
#[cfg_attr(docsrs, doc(cfg(feature = "v2_84")))]
9684
#[doc(alias = "g_unix_mount_entry_guess_can_eject")]
97-
pub fn guess_can_eject(&mut self) -> bool {
85+
pub fn guess_can_eject(&self) -> bool {
9886
unsafe {
99-
from_glib(ffi::g_unix_mount_entry_guess_can_eject(
100-
self.to_glib_none_mut().0,
101-
))
87+
from_glib(ffi::g_unix_mount_entry_guess_can_eject(mut_override(
88+
self.to_glib_none().0,
89+
)))
10290
}
10391
}
10492

105-
#[cfg(feature = "v2_84")]
106-
#[cfg_attr(docsrs, doc(cfg(feature = "v2_84")))]
10793
#[doc(alias = "g_unix_mount_entry_guess_icon")]
108-
pub fn guess_icon(&mut self) -> Icon {
94+
pub fn guess_icon(&self) -> Icon {
10995
unsafe {
110-
from_glib_full(ffi::g_unix_mount_entry_guess_icon(
111-
self.to_glib_none_mut().0,
112-
))
96+
from_glib_full(ffi::g_unix_mount_entry_guess_icon(mut_override(
97+
self.to_glib_none().0,
98+
)))
11399
}
114100
}
115101

116-
#[cfg(feature = "v2_84")]
117-
#[cfg_attr(docsrs, doc(cfg(feature = "v2_84")))]
118102
#[doc(alias = "g_unix_mount_entry_guess_name")]
119-
pub fn guess_name(&mut self) -> glib::GString {
103+
pub fn guess_name(&self) -> glib::GString {
120104
unsafe {
121-
from_glib_full(ffi::g_unix_mount_entry_guess_name(
122-
self.to_glib_none_mut().0,
123-
))
105+
from_glib_full(ffi::g_unix_mount_entry_guess_name(mut_override(
106+
self.to_glib_none().0,
107+
)))
124108
}
125109
}
126110

127-
#[cfg(feature = "v2_84")]
128-
#[cfg_attr(docsrs, doc(cfg(feature = "v2_84")))]
129111
#[doc(alias = "g_unix_mount_entry_guess_should_display")]
130-
pub fn guess_should_display(&mut self) -> bool {
112+
pub fn guess_should_display(&self) -> bool {
131113
unsafe {
132-
from_glib(ffi::g_unix_mount_entry_guess_should_display(
133-
self.to_glib_none_mut().0,
134-
))
114+
from_glib(ffi::g_unix_mount_entry_guess_should_display(mut_override(
115+
self.to_glib_none().0,
116+
)))
135117
}
136118
}
137119

138-
#[cfg(feature = "v2_84")]
139-
#[cfg_attr(docsrs, doc(cfg(feature = "v2_84")))]
140120
#[doc(alias = "g_unix_mount_entry_guess_symbolic_icon")]
141-
pub fn guess_symbolic_icon(&mut self) -> Icon {
121+
pub fn guess_symbolic_icon(&self) -> Icon {
142122
unsafe {
143-
from_glib_full(ffi::g_unix_mount_entry_guess_symbolic_icon(
144-
self.to_glib_none_mut().0,
145-
))
123+
from_glib_full(ffi::g_unix_mount_entry_guess_symbolic_icon(mut_override(
124+
self.to_glib_none().0,
125+
)))
146126
}
147127
}
148128

149-
#[cfg(feature = "v2_84")]
150-
#[cfg_attr(docsrs, doc(cfg(feature = "v2_84")))]
151129
#[doc(alias = "g_unix_mount_entry_is_readonly")]
152-
pub fn is_readonly(&mut self) -> bool {
130+
pub fn is_readonly(&self) -> bool {
153131
unsafe {
154-
from_glib(ffi::g_unix_mount_entry_is_readonly(
155-
self.to_glib_none_mut().0,
156-
))
132+
from_glib(ffi::g_unix_mount_entry_is_readonly(mut_override(
133+
self.to_glib_none().0,
134+
)))
157135
}
158136
}
159137

160-
#[cfg(feature = "v2_84")]
161-
#[cfg_attr(docsrs, doc(cfg(feature = "v2_84")))]
162138
#[doc(alias = "g_unix_mount_entry_is_system_internal")]
163-
pub fn is_system_internal(&mut self) -> bool {
139+
pub fn is_system_internal(&self) -> bool {
164140
unsafe {
165-
from_glib(ffi::g_unix_mount_entry_is_system_internal(
166-
self.to_glib_none_mut().0,
167-
))
141+
from_glib(ffi::g_unix_mount_entry_is_system_internal(mut_override(
142+
self.to_glib_none().0,
143+
)))
168144
}
169145
}
170146

171-
#[cfg(feature = "v2_84")]
172-
#[cfg_attr(docsrs, doc(cfg(feature = "v2_84")))]
173147
#[doc(alias = "g_unix_mount_entry_at")]
174-
pub fn at(mount_path: impl AsRef<std::path::Path>) -> (Option<UnixMountEntry>, u64) {
148+
#[doc(alias = "at")]
149+
pub fn for_mount_path(
150+
mount_path: impl AsRef<std::path::Path>,
151+
) -> (Option<UnixMountEntry>, u64) {
175152
unsafe {
176153
let mut time_read = std::mem::MaybeUninit::uninit();
177154
let ret = from_glib_full(ffi::g_unix_mount_entry_at(
@@ -182,11 +159,9 @@ impl UnixMountEntry {
182159
}
183160
}
184161

185-
#[cfg(feature = "v2_84")]
186-
#[cfg_attr(docsrs, doc(cfg(feature = "v2_84")))]
187162
#[doc(alias = "g_unix_mount_entry_for")]
188163
#[doc(alias = "for")]
189-
pub fn for_(file_path: impl AsRef<std::path::Path>) -> (Option<UnixMountEntry>, u64) {
164+
pub fn for_file_path(file_path: impl AsRef<std::path::Path>) -> (Option<UnixMountEntry>, u64) {
190165
unsafe {
191166
let mut time_read = std::mem::MaybeUninit::uninit();
192167
let ret = from_glib_full(ffi::g_unix_mount_entry_for(
@@ -198,8 +173,6 @@ impl UnixMountEntry {
198173
}
199174
}
200175

201-
#[cfg(feature = "v2_84")]
202-
#[cfg_attr(docsrs, doc(cfg(feature = "v2_84")))]
203176
impl PartialEq for UnixMountEntry {
204177
#[inline]
205178
fn eq(&self, other: &Self) -> bool {
@@ -209,8 +182,6 @@ impl PartialEq for UnixMountEntry {
209182

210183
impl Eq for UnixMountEntry {}
211184

212-
#[cfg(feature = "v2_84")]
213-
#[cfg_attr(docsrs, doc(cfg(feature = "v2_84")))]
214185
impl PartialOrd for UnixMountEntry {
215186
#[inline]
216187
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {

0 commit comments

Comments
 (0)