docx_reader/documents/elements/
data_binding.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
use serde::Serialize;

#[derive(Serialize, Debug, Clone, PartialEq, Default)]
pub struct DataBinding {
	pub xpath: Option<String>,
	pub prefix_mappings: Option<String>,
	pub store_item_id: Option<String>,
}

impl DataBinding {
	pub fn new() -> Self {
		Default::default()
	}

	pub fn xpath(mut self, xpath: impl Into<String>) -> Self {
		self.xpath = Some(xpath.into());
		self
	}

	pub fn prefix_mappings(mut self, m: impl Into<String>) -> Self {
		self.prefix_mappings = Some(m.into());
		self
	}

	pub fn store_item_id(mut self, id: impl Into<String>) -> Self {
		self.store_item_id = Some(id.into());
		self
	}
}