rs_docx/font_table/family.rs
1use hard_xml::{XmlRead, XmlWrite};
2use std::borrow::Cow;
3
4#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
5#[cfg_attr(test, derive(PartialEq))]
6#[xml(tag = "w:family")]
7pub struct Family<'a> {
8 #[xml(attr = "w:val")]
9 pub value: Option<Cow<'a, str>>,
10}
11
12impl<'a, S: Into<Cow<'a, str>>> From<S> for Family<'a> {
13 fn from(s: S) -> Self {
14 Family {
15 value: Some(s.into()),
16 }
17 }
18}