gio/auto/
settings_schema.rs1use crate::{ffi, SettingsSchemaKey};
6use glib::translate::*;
7
8glib::wrapper! {
9 #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
10 pub struct SettingsSchema(Shared<ffi::GSettingsSchema>);
11
12 match fn {
13 ref => |ptr| ffi::g_settings_schema_ref(ptr),
14 unref => |ptr| ffi::g_settings_schema_unref(ptr),
15 type_ => || ffi::g_settings_schema_get_type(),
16 }
17}
18
19impl SettingsSchema {
20 #[doc(alias = "g_settings_schema_get_id")]
21 #[doc(alias = "get_id")]
22 pub fn id(&self) -> glib::GString {
23 unsafe { from_glib_none(ffi::g_settings_schema_get_id(self.to_glib_none().0)) }
24 }
25
26 #[doc(alias = "g_settings_schema_get_key")]
27 #[doc(alias = "get_key")]
28 pub fn key(&self, name: &str) -> SettingsSchemaKey {
29 unsafe {
30 from_glib_full(ffi::g_settings_schema_get_key(
31 self.to_glib_none().0,
32 name.to_glib_none().0,
33 ))
34 }
35 }
36
37 #[doc(alias = "g_settings_schema_get_path")]
38 #[doc(alias = "get_path")]
39 pub fn path(&self) -> Option<glib::GString> {
40 unsafe { from_glib_none(ffi::g_settings_schema_get_path(self.to_glib_none().0)) }
41 }
42
43 #[doc(alias = "g_settings_schema_has_key")]
44 pub fn has_key(&self, name: &str) -> bool {
45 unsafe {
46 from_glib(ffi::g_settings_schema_has_key(
47 self.to_glib_none().0,
48 name.to_glib_none().0,
49 ))
50 }
51 }
52
53 #[doc(alias = "g_settings_schema_list_children")]
54 pub fn list_children(&self) -> Vec<glib::GString> {
55 unsafe {
56 FromGlibPtrContainer::from_glib_full(ffi::g_settings_schema_list_children(
57 self.to_glib_none().0,
58 ))
59 }
60 }
61
62 #[doc(alias = "g_settings_schema_list_keys")]
63 pub fn list_keys(&self) -> Vec<glib::GString> {
64 unsafe {
65 FromGlibPtrContainer::from_glib_full(ffi::g_settings_schema_list_keys(
66 self.to_glib_none().0,
67 ))
68 }
69 }
70}