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

use crate::types::*;

#[derive(Debug, Clone, Deserialize, PartialEq)]
pub struct Break {
	break_type: BreakType,
}

impl Break {
	pub fn new(t: BreakType) -> Break {
		Break { break_type: t }
	}
}

impl Serialize for Break {
	fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
	where
		S: Serializer,
	{
		let mut t = serializer.serialize_struct("Break", 1)?;
		t.serialize_field("breakType", &format!("{}", &self.break_type))?;
		t.end()
	}
}