docx_reader/documents/
numberings.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
use super::*;

use serde::Serialize;

#[derive(Debug, Clone, PartialEq, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct Numberings {
	pub abstract_nums: Vec<AbstractNumbering>,
	pub numberings: Vec<Numbering>,
}

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

	pub fn add_abstract_numbering(mut self, n: AbstractNumbering) -> Self {
		self.abstract_nums.push(n);
		self
	}

	pub fn add_numbering(mut self, n: Numbering) -> Self {
		self.numberings.push(n);
		self
	}
}

impl Default for Numberings {
	fn default() -> Self {
		Self {
			abstract_nums: vec![],
			numberings: vec![],
		}
	}
}