docx_reader/documents/elements/
run_style.rsuse serde::{Serialize, Serializer};
#[derive(Debug, Clone, PartialEq)]
pub struct RunStyle {
pub val: String,
}
impl Default for RunStyle {
fn default() -> Self {
RunStyle {
val: "Normal".to_owned(),
}
}
}
impl RunStyle {
pub fn new(val: impl Into<String>) -> RunStyle {
RunStyle { val: val.into() }
}
}
impl Serialize for RunStyle {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: Serializer,
{
serializer.serialize_str(&self.val)
}
}