udisks/
partition.rs

1use zbus::dbus_proxy;
2
3#[dbus_proxy(interface = "org.freedesktop.UDisks2.PartitionTable")]
4trait PartitionTable {
5    /// CreatePartition method
6    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    /// CreatePartitionAndFormat method
16    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    /// Partitions property
28    #[dbus_proxy(property)]
29    fn partitions(&self) -> zbus::Result<Vec<zbus::zvariant::OwnedObjectPath>>;
30
31    /// Type property
32    #[dbus_proxy(property)]
33    fn type_(&self) -> zbus::Result<String>;
34}
35
36#[dbus_proxy(interface = "org.freedesktop.UDisks2.Partition")]
37trait Partition {
38    /// Delete method
39    fn delete(
40        &self,
41        options: std::collections::HashMap<&str, zbus::zvariant::Value<'_>>,
42    ) -> zbus::Result<()>;
43
44    /// Resize method
45    fn resize(
46        &self,
47        size: u64,
48        options: std::collections::HashMap<&str, zbus::zvariant::Value<'_>>,
49    ) -> zbus::Result<()>;
50
51    /// SetFlags method
52    fn set_flags(
53        &self,
54        flags: u64,
55        options: std::collections::HashMap<&str, zbus::zvariant::Value<'_>>,
56    ) -> zbus::Result<()>;
57
58    /// SetName method
59    fn set_name(
60        &self,
61        name: &str,
62        options: std::collections::HashMap<&str, zbus::zvariant::Value<'_>>,
63    ) -> zbus::Result<()>;
64
65    /// SetType method
66    fn set_type(
67        &self,
68        type_: &str,
69        options: std::collections::HashMap<&str, zbus::zvariant::Value<'_>>,
70    ) -> zbus::Result<()>;
71
72    /// Flags property
73    #[dbus_proxy(property)]
74    fn flags(&self) -> zbus::Result<u64>;
75
76    /// IsContained property
77    #[dbus_proxy(property)]
78    fn is_contained(&self) -> zbus::Result<bool>;
79
80    /// IsContainer property
81    #[dbus_proxy(property)]
82    fn is_container(&self) -> zbus::Result<bool>;
83
84    /// Name property
85    #[dbus_proxy(property)]
86    fn name(&self) -> zbus::Result<String>;
87
88    /// Number property
89    #[dbus_proxy(property)]
90    fn number(&self) -> zbus::Result<u32>;
91
92    /// Offset property
93    #[dbus_proxy(property)]
94    fn offset(&self) -> zbus::Result<u64>;
95
96    /// Size property
97    #[dbus_proxy(property)]
98    fn size(&self) -> zbus::Result<u64>;
99
100    /// Table property
101    #[dbus_proxy(property)]
102    fn table(&self) -> zbus::Result<zbus::zvariant::OwnedObjectPath>;
103
104    /// Type property
105    #[dbus_proxy(property)]
106    fn type_(&self) -> zbus::Result<String>;
107
108    /// UUID property
109    #[dbus_proxy(property)]
110    fn uuid(&self) -> zbus::Result<String>;
111}