1use chrono::NaiveDateTime;
2use uuid::Uuid;
3
4use crate::db::{Color, CustomData};
5
6#[derive(Debug, Default, Eq, PartialEq, Clone)]
8#[cfg_attr(feature = "serialization", derive(serde::Serialize))]
9pub struct Meta {
10 pub generator: Option<String>,
12
13 pub database_name: Option<String>,
15
16 pub database_name_changed: Option<NaiveDateTime>,
18
19 pub database_description: Option<String>,
21
22 pub database_description_changed: Option<NaiveDateTime>,
24
25 pub default_username: Option<String>,
27
28 pub default_username_changed: Option<NaiveDateTime>,
30
31 pub maintenance_history_days: Option<usize>,
33
34 pub color: Option<Color>,
36
37 pub master_key_changed: Option<NaiveDateTime>,
39
40 pub master_key_change_rec: Option<isize>,
41
42 pub master_key_change_force: Option<isize>,
43
44 pub memory_protection: Option<MemoryProtection>,
46
47 pub custom_icons: CustomIcons,
49
50 pub recyclebin_enabled: Option<bool>,
52
53 pub recyclebin_uuid: Option<Uuid>,
55
56 pub recyclebin_changed: Option<NaiveDateTime>,
58
59 pub entry_templates_group: Option<Uuid>,
61
62 pub entry_templates_group_changed: Option<NaiveDateTime>,
64
65 pub last_selected_group: Option<Uuid>,
67
68 pub last_top_visible_group: Option<Uuid>,
70
71 pub history_max_items: Option<usize>,
73
74 pub history_max_size: Option<usize>,
76
77 pub settings_changed: Option<NaiveDateTime>,
79
80 pub binaries: BinaryAttachments,
82
83 pub custom_data: CustomData,
85}
86
87#[derive(Debug, PartialEq, Eq, Clone)]
89#[cfg_attr(feature = "serialization", derive(serde::Serialize))]
90pub struct MemoryProtection {
91 pub protect_title: bool,
93
94 pub protect_username: bool,
96
97 pub protect_password: bool,
99
100 pub protect_url: bool,
102
103 pub protect_notes: bool,
105}
106
107impl Default for MemoryProtection {
108 fn default() -> Self {
109 Self {
110 protect_title: false,
111 protect_username: false,
112 protect_password: true,
113 protect_url: false,
114 protect_notes: false,
115 }
116 }
117}
118
119#[derive(Debug, Default, PartialEq, Eq, Clone)]
121#[cfg_attr(feature = "serialization", derive(serde::Serialize))]
122pub struct CustomIcons {
123 pub icons: Vec<Icon>,
124}
125
126#[derive(Debug, Default, PartialEq, Eq, Clone)]
128#[cfg_attr(feature = "serialization", derive(serde::Serialize))]
129pub struct Icon {
130 pub uuid: Uuid,
132
133 pub data: Vec<u8>,
135}
136
137#[derive(Debug, Default, PartialEq, Eq, Clone)]
139#[cfg_attr(feature = "serialization", derive(serde::Serialize))]
140pub struct BinaryAttachments {
141 pub binaries: Vec<BinaryAttachment>,
142}
143
144#[derive(Debug, Default, PartialEq, Eq, Clone)]
146#[cfg_attr(feature = "serialization", derive(serde::Serialize))]
147pub struct BinaryAttachment {
148 pub identifier: Option<String>,
149 pub compressed: bool,
150 pub content: Vec<u8>,
151}