docx_reader/documents/elements/start.rs
use serde::{Serialize, Serializer};
#[derive(Debug, Clone, PartialEq)]
pub struct Start {
val: usize,
}
impl Start {
pub fn new(val: usize) -> Start {
Start { val }
}
}
impl Default for Start {
fn default() -> Self {
Start { val: 0 }
}
}
impl Serialize for Start {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: Serializer,
{
serializer.serialize_u32(self.val as u32)
}
}