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

#[derive(Debug, Clone, PartialEq, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct Numbering {
	pub id: usize,
	pub abstract_num_id: usize,
	pub level_overrides: Vec<LevelOverride>,
}

impl Numbering {
	pub fn new(id: usize, abstract_num_id: usize) -> Self {
		Self {
			id,
			abstract_num_id,
			level_overrides: vec![],
		}
	}

	pub fn overrides(mut self, overrides: Vec<LevelOverride>) -> Self {
		self.level_overrides = overrides;
		self
	}

	pub fn add_override(mut self, o: LevelOverride) -> Self {
		self.level_overrides.push(o);
		self
	}
}