docx_reader/documents/elements/
shape.rs1use serde::Serialize;
2
3#[derive(Serialize, Debug, Clone, PartialEq, Default)]
4#[serde(rename_all = "camelCase")]
5pub struct Shape {
6 #[serde(skip_serializing_if = "Option::is_none")]
7 pub style: Option<String>,
8 #[serde(skip_serializing_if = "Option::is_none")]
9 pub image_data: Option<ImageData>,
10}
11#[derive(Serialize, Debug, Clone, PartialEq, Default)]
14#[serde(rename_all = "camelCase")]
15pub struct ImageData {
16 pub id: String,
17}
18
19impl Shape {
20 pub fn new() -> Self {
21 Default::default()
22 }
23
24 pub fn style(mut self, style: impl Into<String>) -> Self {
25 self.style = Some(style.into());
26 self
27 }
28
29 pub fn image_data(mut self, id: impl Into<String>) -> Self {
30 self.image_data = Some(ImageData { id: id.into() });
31 self
32 }
33}
34
35