docx_reader/documents/doc_props/
custom.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use serde::Serialize;

#[derive(Debug, Clone, PartialEq, Serialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct CustomProps {
	pub properties: std::collections::HashMap<String, String>,
}

impl CustomProps {
	pub(crate) fn new() -> Self {
		Self::default()
	}

	pub fn add_custom_property(mut self, name: impl Into<String>, item: impl Into<String>) -> Self {
		self.properties.insert(name.into(), item.into());
		self
	}
}