docx_reader/documents/
webextension.rs1use serde::Serialize;
2
3#[derive(Serialize, Debug, PartialEq, Clone)]
4pub struct WebExtensionProperty {
5 pub name: String,
6 pub value: String,
7}
8
9impl WebExtensionProperty {
10 pub fn new(name: impl Into<String>, value: impl Into<String>) -> Self {
11 Self {
12 name: name.into(),
13 value: value.into(),
14 }
15 }
16}
17
18#[derive(Serialize, Debug, PartialEq, Clone)]
19pub struct WebExtension {
20 pub id: String,
21 pub version: String,
22 pub store: String,
23 pub store_type: String,
24 pub reference_id: String,
25 pub properties: Vec<WebExtensionProperty>,
26}
27
28impl WebExtension {
29 pub fn new(
30 id: impl Into<String>,
31 reference_id: impl Into<String>,
32 version: impl Into<String>,
33 store: impl Into<String>,
34 store_type: impl Into<String>,
35 ) -> Self {
36 Self {
37 id: id.into(),
38 reference_id: reference_id.into(),
39 version: version.into(),
40 store: store.into(),
41 store_type: store_type.into(),
42 properties: vec![],
43 }
44 }
45}