docx_rs/documents/elements/
adjust_right_ind.rs1use serde::{Serialize, Serializer};
2use std::io::Write;
3
4use crate::documents::BuildXML;
5use crate::xml_builder::*;
6
7#[derive(Debug, Clone, PartialEq)]
8pub struct AdjustRightInd(pub isize);
9
10impl AdjustRightInd {
11 pub fn new(val: isize) -> AdjustRightInd {
12 AdjustRightInd(val)
13 }
14}
15
16impl BuildXML for AdjustRightInd {
17 fn build_to<W: Write>(
18 &self,
19 stream: xml::writer::EventWriter<W>,
20 ) -> xml::writer::Result<xml::writer::EventWriter<W>> {
21 XMLBuilder::from(stream)
22 .adjust_right_ind(self.0)?
23 .into_inner()
24 }
25}
26
27impl Serialize for AdjustRightInd {
28 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
29 where
30 S: Serializer,
31 {
32 serializer.serialize_i64(self.0 as i64)
33 }
34}