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

#[derive(Debug, Clone, PartialEq, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct HeaderReference {
	pub header_type: String,
	pub id: String,
}

impl Default for HeaderReference {
	fn default() -> HeaderReference {
		HeaderReference {
			header_type: "default".to_owned(),
			id: "rId4".to_owned(),
		}
	}
}

impl HeaderReference {
	pub fn new(t: impl Into<String>, id: impl Into<String>) -> HeaderReference {
		HeaderReference {
			header_type: t.into(),
			id: id.into(),
		}
	}
}