docx_reader/documents/
webextension.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
use serde::Serialize;

#[derive(Serialize, Debug, PartialEq, Clone)]
pub struct WebExtensionProperty {
	pub name: String,
	pub value: String,
}

impl WebExtensionProperty {
	pub fn new(name: impl Into<String>, value: impl Into<String>) -> Self {
		Self {
			name: name.into(),
			value: value.into(),
		}
	}
}

#[derive(Serialize, Debug, PartialEq, Clone)]
pub struct WebExtension {
	pub id: String,
	pub version: String,
	pub store: String,
	pub store_type: String,
	pub reference_id: String,
	pub properties: Vec<WebExtensionProperty>,
}

impl WebExtension {
	pub fn new(
		id: impl Into<String>,
		reference_id: impl Into<String>,
		version: impl Into<String>,
		store: impl Into<String>,
		store_type: impl Into<String>,
	) -> Self {
		Self {
			id: id.into(),
			reference_id: reference_id.into(),
			version: version.into(),
			store: store.into(),
			store_type: store_type.into(),
			properties: vec![],
		}
	}
}