docx_reader/documents/elements/start.rs
1use serde::{Serialize, Serializer};
2
3#[derive(Debug, Clone, PartialEq)]
4pub struct Start {
5 val: usize,
6}
7
8impl Start {
9 pub fn new(val: usize) -> Start {
10 Start { val }
11 }
12}
13
14impl Default for Start {
15 fn default() -> Self {
16 Start { val: 0 }
17 }
18}
19
20impl Serialize for Start {
21 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
22 where
23 S: Serializer,
24 {
25 serializer.serialize_u32(self.val as u32)
26 }
27}