1use zbus::proxy;
14
15use crate::error;
16
17#[proxy(
18 interface = "org.freedesktop.UDisks2.Encrypted",
19 default_service = "org.freedesktop.UDisks2",
20 default_path = "/org/freedesktop/UDisks2/Encrypted"
21)]
22pub trait Encrypted {
23 fn change_passphrase(
25 &self,
26 passphrase: &str,
27 new_passphrase: &str,
28 options: std::collections::HashMap<&str, zbus::zvariant::Value<'_>>,
29 ) -> error::Result<()>;
30
31 fn lock(
33 &self,
34 options: std::collections::HashMap<&str, zbus::zvariant::Value<'_>>,
35 ) -> error::Result<()>;
36
37 fn resize(
39 &self,
40 size: u64,
41 options: std::collections::HashMap<&str, zbus::zvariant::Value<'_>>,
42 ) -> error::Result<()>;
43
44 fn unlock(
46 &self,
47 passphrase: &str,
48 options: std::collections::HashMap<&str, zbus::zvariant::Value<'_>>,
49 ) -> error::Result<zbus::zvariant::OwnedObjectPath>;
50
51 #[zbus(property)]
53 fn child_configuration(
54 &self,
55 ) -> error::Result<
56 Vec<(
57 String,
58 std::collections::HashMap<String, zbus::zvariant::OwnedValue>,
59 )>,
60 >;
61
62 #[zbus(property)]
64 fn cleartext_device(&self) -> error::Result<zbus::zvariant::OwnedObjectPath>;
65
66 #[zbus(property)]
68 fn hint_encryption_type(&self) -> error::Result<String>;
69
70 #[zbus(property)]
72 fn metadata_size(&self) -> error::Result<u64>;
73}