docx_rs/documents/elements/
cant_split.rs

1use serde::{Serialize, Serializer};
2use std::io::Write;
3
4use crate::{xml_builder::XMLBuilder, BuildXML};
5
6#[derive(Debug, Clone, PartialEq, Eq, Default)]
7pub struct CantSplit {}
8impl BuildXML for CantSplit {
9    fn build_to<W: Write>(
10        &self,
11        stream: xml::writer::EventWriter<W>,
12    ) -> xml::writer::Result<xml::writer::EventWriter<W>> {
13        XMLBuilder::from(stream).cant_split()?.into_inner()
14    }
15}
16
17impl Serialize for CantSplit {
18    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
19    where
20        S: Serializer,
21    {
22        serializer.serialize_str("cantSplit")
23    }
24}