1use zbus::dbus_proxy;
2
3#[dbus_proxy(interface = "org.freedesktop.UDisks2.PartitionTable")]
4trait PartitionTable {
5 fn create_partition(
7 &self,
8 offset: u64,
9 size: u64,
10 type_: &str,
11 name: &str,
12 options: std::collections::HashMap<&str, zbus::zvariant::Value<'_>>,
13 ) -> zbus::Result<zbus::zvariant::OwnedObjectPath>;
14
15 fn create_partition_and_format(
17 &self,
18 offset: u64,
19 size: u64,
20 type_: &str,
21 name: &str,
22 options: std::collections::HashMap<&str, zbus::zvariant::Value<'_>>,
23 format_type: &str,
24 format_options: std::collections::HashMap<&str, zbus::zvariant::Value<'_>>,
25 ) -> zbus::Result<zbus::zvariant::OwnedObjectPath>;
26
27 #[dbus_proxy(property)]
29 fn partitions(&self) -> zbus::Result<Vec<zbus::zvariant::OwnedObjectPath>>;
30
31 #[dbus_proxy(property)]
33 fn type_(&self) -> zbus::Result<String>;
34}
35
36#[dbus_proxy(interface = "org.freedesktop.UDisks2.Partition")]
37trait Partition {
38 fn delete(
40 &self,
41 options: std::collections::HashMap<&str, zbus::zvariant::Value<'_>>,
42 ) -> zbus::Result<()>;
43
44 fn resize(
46 &self,
47 size: u64,
48 options: std::collections::HashMap<&str, zbus::zvariant::Value<'_>>,
49 ) -> zbus::Result<()>;
50
51 fn set_flags(
53 &self,
54 flags: u64,
55 options: std::collections::HashMap<&str, zbus::zvariant::Value<'_>>,
56 ) -> zbus::Result<()>;
57
58 fn set_name(
60 &self,
61 name: &str,
62 options: std::collections::HashMap<&str, zbus::zvariant::Value<'_>>,
63 ) -> zbus::Result<()>;
64
65 fn set_type(
67 &self,
68 type_: &str,
69 options: std::collections::HashMap<&str, zbus::zvariant::Value<'_>>,
70 ) -> zbus::Result<()>;
71
72 #[dbus_proxy(property)]
74 fn flags(&self) -> zbus::Result<u64>;
75
76 #[dbus_proxy(property)]
78 fn is_contained(&self) -> zbus::Result<bool>;
79
80 #[dbus_proxy(property)]
82 fn is_container(&self) -> zbus::Result<bool>;
83
84 #[dbus_proxy(property)]
86 fn name(&self) -> zbus::Result<String>;
87
88 #[dbus_proxy(property)]
90 fn number(&self) -> zbus::Result<u32>;
91
92 #[dbus_proxy(property)]
94 fn offset(&self) -> zbus::Result<u64>;
95
96 #[dbus_proxy(property)]
98 fn size(&self) -> zbus::Result<u64>;
99
100 #[dbus_proxy(property)]
102 fn table(&self) -> zbus::Result<zbus::zvariant::OwnedObjectPath>;
103
104 #[dbus_proxy(property)]
106 fn type_(&self) -> zbus::Result<String>;
107
108 #[dbus_proxy(property)]
110 fn uuid(&self) -> zbus::Result<String>;
111}