pub struct SmartArtRef {
pub raw_xml: String,
pub dm_rid: Option<String>,
pub lo_rid: Option<String>,
pub qs_rid: Option<String>,
pub cs_rid: Option<String>,
}Expand description
SmartArt 引用(TODO-037 最小保留)。
持有完整的 <a:graphicData uri=".../diagram">...</a:graphicData> 元素 XML,
用于 read→save 时 byte-exact 保留 SmartArt 在 slide XML 中的引用。
§字段说明
raw_xml:完整的<a:graphicData>元素 XML(含<a:graphicData>外壳), 通常形如<a:graphicData uri=".../diagram"><dgm:relIds r:dm="rId1" r:lo="rId2" r:qs="rId3" r:cs="rId4"/></a:graphicData>。 序列化时由GraphicFrame::write_xml直接 raw 输出,跳过 open_with/close 流程。dm_rid/lo_rid/qs_rid/cs_rid:从 raw_xml 中提取的 4 个关系 id, 仅供调用方查询使用,序列化时不单独输出(直接走 raw_xml)。
Fields§
§raw_xml: String完整的 <a:graphicData> 元素 XML(byte-exact 保留,含外壳)。
dm_rid: Option<String>数据模型关系 id(r:dm,指向 /ppt/diagrams/diagramDataN.xml)。
lo_rid: Option<String>布局定义关系 id(r:lo,指向 /ppt/diagrams/diagramLayoutN.xml)。
qs_rid: Option<String>样式关系 id(r:qs,指向 /ppt/diagrams/diagramQuickStyleN.xml)。
cs_rid: Option<String>颜色关系 id(r:cs,指向 /ppt/diagrams/diagramColorsN.xml)。
Implementations§
Source§impl SmartArtRef
impl SmartArtRef
Sourcepub fn from_rids(dm_rid: &str, lo_rid: &str, qs_rid: &str, cs_rid: &str) -> Self
pub fn from_rids(dm_rid: &str, lo_rid: &str, qs_rid: &str, cs_rid: &str) -> Self
从 4 个关系 id 构造 SmartArtRef(用于创建路径,TODO-037 创建 API)。
用 XmlWriter 链式 API 构造 raw_xml,
不用 format! 字符串拼接(遵守 .trae/rules/project_rules.md §5 安全红线)。
§参数
dm_rid/lo_rid/qs_rid/cs_rid:4 个关系 id,分别指向 data / layout / quickStyle / colors 四个 diagram part。
§生成内容
<a:graphicData uri="http://schemas.openxmlformats.org/drawingml/2006/diagram">
<dgm:relIds xmlns:dgm="..." xmlns:r="..."
r:dm="..." r:lo="..." r:qs="..." r:cs="..."/>
</a:graphicData>§示例
use pptx_rs::oxml::shape::SmartArtRef;
let r = SmartArtRef::from_rids("rId1", "rId2", "rId3", "rId4");
assert!(r.raw_xml.contains("r:dm=\"rId1\""));Trait Implementations§
Source§impl Clone for SmartArtRef
impl Clone for SmartArtRef
Source§fn clone(&self) -> SmartArtRef
fn clone(&self) -> SmartArtRef
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 SmartArtRef
impl Debug for SmartArtRef
Source§impl Default for SmartArtRef
impl Default for SmartArtRef
Source§fn default() -> SmartArtRef
fn default() -> SmartArtRef
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SmartArtRef
impl RefUnwindSafe for SmartArtRef
impl Send for SmartArtRef
impl Sync for SmartArtRef
impl Unpin for SmartArtRef
impl UnsafeUnpin for SmartArtRef
impl UnwindSafe for SmartArtRef
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