docx_reader/documents/elements/
abstract_numbering.rsuse crate::documents::Level;
use serde::Serialize;
#[derive(Debug, Clone, PartialEq, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct AbstractNumbering {
pub id: usize,
pub style_link: Option<String>,
pub num_style_link: Option<String>,
pub levels: Vec<Level>,
}
impl AbstractNumbering {
pub fn new(id: usize) -> Self {
Self {
id,
style_link: None,
num_style_link: None,
levels: vec![],
}
}
pub fn add_level(mut self, level: Level) -> Self {
self.levels.push(level);
self
}
pub fn num_style_link(mut self, link: impl Into<String>) -> Self {
self.num_style_link = Some(link.into());
self
}
pub fn style_link(mut self, link: impl Into<String>) -> Self {
self.style_link = Some(link.into());
self
}
}