secret_service/proxy/
item.rs

1//! A dbus proxy for speaking with secret service's `Item` Interface.
2
3use std::collections::HashMap;
4use zbus::zvariant::{ObjectPath, OwnedObjectPath};
5
6use super::SecretStruct;
7
8/// A dbus proxy for speaking with secret service's `Item` Interface.
9///
10/// This will derive ItemProxy
11#[zbus::proxy(
12    interface = "org.freedesktop.Secret.Item",
13    default_service = "org.freedesktop.Secret.Item"
14)]
15pub trait Item {
16    fn delete(&self) -> zbus::Result<OwnedObjectPath>;
17
18    /// returns `Secret`
19    fn get_secret(&self, session: &ObjectPath<'_>) -> zbus::Result<SecretStruct>;
20
21    fn set_secret(&self, secret: SecretStruct) -> zbus::Result<()>;
22
23    #[zbus(property)]
24    fn locked(&self) -> zbus::fdo::Result<bool>;
25
26    #[zbus(property)]
27    fn attributes(&self) -> zbus::fdo::Result<HashMap<String, String>>;
28
29    #[zbus(property)]
30    fn set_attributes(&self, attributes: HashMap<&str, &str>) -> zbus::fdo::Result<()>;
31
32    #[zbus(property)]
33    fn label(&self) -> zbus::fdo::Result<String>;
34
35    #[zbus(property)]
36    fn set_label(&self, new_label: &str) -> zbus::fdo::Result<()>;
37
38    #[zbus(property)]
39    fn created(&self) -> zbus::fdo::Result<u64>;
40
41    #[zbus(property)]
42    fn modified(&self) -> zbus::fdo::Result<u64>;
43}