1use std::collections::HashMap;
2
3use chrono::NaiveDateTime;
4use uuid::Uuid;
5
6use crate::db::{Color, CustomDataItem};
7
8#[derive(Debug, Default, Eq, PartialEq, Clone)]
10#[cfg_attr(feature = "serialization", derive(serde::Serialize))]
11pub struct Meta {
12 pub generator: Option<String>,
14
15 pub database_name: Option<String>,
17
18 pub database_name_changed: Option<NaiveDateTime>,
20
21 pub database_description: Option<String>,
23
24 pub database_description_changed: Option<NaiveDateTime>,
26
27 pub default_username: Option<String>,
29
30 pub default_username_changed: Option<NaiveDateTime>,
32
33 pub maintenance_history_days: Option<usize>,
35
36 pub color: Option<Color>,
38
39 pub master_key_changed: Option<NaiveDateTime>,
41
42 pub master_key_change_rec: Option<isize>,
44
45 pub master_key_change_force: Option<isize>,
47
48 pub memory_protection: Option<MemoryProtection>,
50
51 pub recyclebin_enabled: Option<bool>,
53
54 pub recyclebin_uuid: Option<Uuid>,
56
57 pub recyclebin_changed: Option<NaiveDateTime>,
59
60 pub entry_templates_group: Option<Uuid>,
62
63 pub entry_templates_group_changed: Option<NaiveDateTime>,
65
66 pub last_selected_group: Option<Uuid>,
68
69 pub last_top_visible_group: Option<Uuid>,
71
72 pub history_max_items: Option<isize>,
74
75 pub history_max_size: Option<isize>,
77
78 pub settings_changed: Option<NaiveDateTime>,
80
81 pub custom_data: HashMap<String, CustomDataItem>,
83}
84
85#[derive(Debug, PartialEq, Eq, Clone)]
87#[cfg_attr(feature = "serialization", derive(serde::Serialize))]
88pub struct MemoryProtection {
89 pub protect_title: bool,
91
92 pub protect_username: bool,
94
95 pub protect_password: bool,
97
98 pub protect_url: bool,
100
101 pub protect_notes: bool,
103}
104
105impl Default for MemoryProtection {
106 fn default() -> Self {
107 Self {
108 protect_title: false,
109 protect_username: false,
110 protect_password: true,
111 protect_url: false,
112 protect_notes: false,
113 }
114 }
115}