docx_reader/documents/elements/
tab.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
use serde::{Deserialize, Serialize};

use crate::types::*;

#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, Default)]
pub struct Tab {
	pub val: Option<TabValueType>,
	pub leader: Option<TabLeaderType>,
	pub pos: Option<usize>,
}

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

	pub fn val(mut self, v: TabValueType) -> Self {
		self.val = Some(v);
		self
	}

	pub fn leader(mut self, v: TabLeaderType) -> Self {
		self.leader = Some(v);
		self
	}

	pub fn pos(mut self, v: usize) -> Self {
		self.pos = Some(v);
		self
	}
}