docx_reader/documents/doc_props/custom.rs
1use serde::Serialize;
2
3#[derive(Debug, Clone, PartialEq, Serialize, Default)]
4#[serde(rename_all = "camelCase")]
5pub struct CustomProps {
6 pub properties: std::collections::HashMap<String, String>,
7}
8
9impl CustomProps {
10 pub(crate) fn new() -> Self {
11 Self::default()
12 }
13
14 pub fn add_custom_property(mut self, name: impl Into<String>, item: impl Into<String>) -> Self {
15 self.properties.insert(name.into(), item.into());
16 self
17 }
18}