defaults_rs/preferences/
types.rs1use crate::PrefValue;
4
5#[derive(Debug, Clone, PartialEq, Eq, Hash)]
7pub enum Domain {
8 User(String),
10 Global,
12}
13
14impl Domain {
15 pub fn get_cf_name(&self) -> String {
17 match &self {
18 Domain::Global => String::from(".GlobalPreferences"),
19 Domain::User(name) => name.clone(),
20 }
21 }
22}
23
24impl std::fmt::Display for Domain {
25 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
26 match self {
27 Domain::User(s) => write!(f, "{}", s),
28 Domain::Global => write!(f, "NSGlobalDomain"),
29 }
30 }
31}
32
33#[derive(Debug)]
35pub struct FindMatch {
36 pub key: String,
37 pub value: PrefValue,
38}