docx_reader/documents/elements/
line_spacing.rsuse crate::line_spacing_type::LineSpacingType;
use serde::*;
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
#[serde(rename_all = "camelCase")]
pub struct LineSpacing {
#[serde(skip_serializing_if = "Option::is_none")]
line_rule: Option<LineSpacingType>,
#[serde(skip_serializing_if = "Option::is_none")]
before: Option<u32>,
#[serde(skip_serializing_if = "Option::is_none")]
after: Option<u32>,
#[serde(skip_serializing_if = "Option::is_none")]
before_lines: Option<u32>,
#[serde(skip_serializing_if = "Option::is_none")]
after_lines: Option<u32>,
#[serde(skip_serializing_if = "Option::is_none")]
line: Option<i32>,
}
impl LineSpacing {
pub fn new() -> Self {
Self::default()
}
pub fn line_rule(mut self, t: LineSpacingType) -> Self {
self.line_rule = Some(t);
self
}
pub fn before(mut self, before: u32) -> Self {
self.before = Some(before);
self
}
pub fn after(mut self, after: u32) -> Self {
self.after = Some(after);
self
}
pub fn before_lines(mut self, before: u32) -> Self {
self.before_lines = Some(before);
self
}
pub fn after_lines(mut self, after: u32) -> Self {
self.after_lines = Some(after);
self
}
pub fn line(mut self, line: i32) -> Self {
self.line = Some(line as i32);
self
}
}