2020-02-11 10:01:39 +02:00
|
|
|
use serde::{Deserialize, Serialize, Serializer};
|
2024-11-05 04:22:32 +02:00
|
|
|
use std::io::Write;
|
2020-02-11 10:01:39 +02:00
|
|
|
|
2019-11-13 09:08:25 +02:00
|
|
|
use crate::documents::BuildXML;
|
|
|
|
|
use crate::xml_builder::*;
|
|
|
|
|
|
2020-02-11 10:01:39 +02:00
|
|
|
#[derive(Debug, Clone, Deserialize, PartialEq)]
|
2021-03-16 10:41:36 +02:00
|
|
|
pub struct BoldCs {
|
2025-05-02 15:28:08 +03:00
|
|
|
pub val: bool,
|
2021-03-16 10:41:36 +02:00
|
|
|
}
|
2019-11-13 09:08:25 +02:00
|
|
|
|
|
|
|
|
impl BoldCs {
|
|
|
|
|
pub fn new() -> BoldCs {
|
2020-01-24 10:57:14 +02:00
|
|
|
Default::default()
|
|
|
|
|
}
|
2021-03-16 10:41:36 +02:00
|
|
|
pub fn disable(mut self) -> BoldCs {
|
|
|
|
|
self.val = false;
|
|
|
|
|
self
|
|
|
|
|
}
|
2020-01-24 10:57:14 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
impl Default for BoldCs {
|
|
|
|
|
fn default() -> Self {
|
2021-03-16 10:41:36 +02:00
|
|
|
Self { val: true }
|
2019-11-13 09:08:25 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-02-11 10:01:39 +02:00
|
|
|
impl Serialize for BoldCs {
|
|
|
|
|
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
|
|
|
|
|
where
|
|
|
|
|
S: Serializer,
|
|
|
|
|
{
|
2021-03-16 10:41:36 +02:00
|
|
|
serializer.serialize_bool(self.val)
|
2020-02-11 10:01:39 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-11-13 09:08:25 +02:00
|
|
|
impl BuildXML for BoldCs {
|
2024-11-05 04:22:32 +02:00
|
|
|
fn build_to<W: Write>(
|
|
|
|
|
&self,
|
|
|
|
|
stream: xml::writer::EventWriter<W>,
|
|
|
|
|
) -> xml::writer::Result<xml::writer::EventWriter<W>> {
|
|
|
|
|
XMLBuilder::from(stream).b_cs()?.into_inner()
|
2019-11-13 09:08:25 +02:00
|
|
|
}
|
|
|
|
|
}
|