diff options
Diffstat (limited to 'libsecret/src/retrievable.rs')
-rw-r--r-- | libsecret/src/retrievable.rs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/libsecret/src/retrievable.rs b/libsecret/src/retrievable.rs new file mode 100644 index 0000000..617d8e3 --- /dev/null +++ b/libsecret/src/retrievable.rs @@ -0,0 +1,20 @@ +use std::collections::HashMap; + +use crate::Retrievable; +use glib::object::IsA; +use glib::translate::*; + +pub trait RetrievableExtManual: 'static { + #[doc(alias = "secret_retrievable_get_attributes")] + #[doc(alias = "get_attributes")] + fn attributes(&self) -> HashMap<String, String>; +} + +impl<O: IsA<Retrievable>> RetrievableExtManual for O { + fn attributes(&self) -> HashMap<String, String> { + unsafe { + let table = ffi::secret_retrievable_get_attributes(self.as_ref().to_glib_none().0); + FromGlibPtrContainer::from_glib_full(table) + } + } +} |