pub struct QuickStyleDef {
pub style_labels: Vec<StyleLabel>,
}Expand description
SmartArt 快速样式(quickStyle part 的半结构化表达)。
对应 /ppt/diagrams/quickStylesN.xml 的 <dgm:styleData> 根元素。
quickStyle 定义了 SmartArt 节点/连接线的视觉样式(填充/边框/效果)。
§半结构化策略
样式标签 <dgm:styleLbl> 内部结构复杂(含 scene3d/sp3d/effectLst/fillLst/lnLst),
本结构仅提取 name 属性,body 保留原始 XML。
Fields§
§style_labels: Vec<StyleLabel>样式标签列表(<dgm:styleLbl>)。
Implementations§
Source§impl QuickStyleDef
impl QuickStyleDef
Sourcepub fn parse_from_xml(xml: &str) -> Result<QuickStyleDef>
pub fn parse_from_xml(xml: &str) -> Result<QuickStyleDef>
从 <dgm:styleData> XML 字符串解析为 QuickStyleDef。
§解析策略
遍历所有 <dgm:styleLbl> 元素(无论嵌套深度),提取 name 属性 + 整段 raw_xml。
raw_xml 通过手动累积事件字节收集,不依赖 buffer_position(),保证 quick-xml 版本兼容。
§错误
Error::Xml:XML 解析失败。
Sourcepub fn to_xml(&self) -> String
pub fn to_xml(&self) -> String
把 QuickStyleDef 序列化为 <dgm:styleData> XML 字符串。
styleLbl 子元素通过 raw_xml 直接透传。
Trait Implementations§
Source§impl Clone for QuickStyleDef
impl Clone for QuickStyleDef
Source§fn clone(&self) -> QuickStyleDef
fn clone(&self) -> QuickStyleDef
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for QuickStyleDef
impl Debug for QuickStyleDef
Source§impl Default for QuickStyleDef
impl Default for QuickStyleDef
Source§fn default() -> QuickStyleDef
fn default() -> QuickStyleDef
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for QuickStyleDef
impl RefUnwindSafe for QuickStyleDef
impl Send for QuickStyleDef
impl Sync for QuickStyleDef
impl Unpin for QuickStyleDef
impl UnsafeUnpin for QuickStyleDef
impl UnwindSafe for QuickStyleDef
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more