docx_rust/document/
grid_column.rs

1use hard_xml::{XmlRead, XmlWrite};
2
3use crate::__xml_test_suites;
4
5/// Grid Column
6///
7/// ```rust
8/// use docx_rust::document::*;
9///
10/// let col = GridColumn::from(42);
11/// ```
12#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
13#[cfg_attr(test, derive(PartialEq))]
14#[xml(tag = "w:gridCol")]
15pub struct GridColumn {
16    #[xml(attr = "w:w")]
17    pub width: isize,
18}
19
20impl From<isize> for GridColumn {
21    fn from(width: isize) -> GridColumn {
22        GridColumn { width }
23    }
24}
25
26__xml_test_suites!(
27    GridColumn,
28    GridColumn::from(42isize),
29    r#"<w:gridCol w:w="42"/>"#,
30);