Skip to main content

SmartArtRef

Struct SmartArtRef 

Source
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

Source

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_xmlformat! 字符串拼接(遵守 .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

Source§

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)

Performs copy-assignment from source. Read more
Source§

impl Debug for SmartArtRef

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for SmartArtRef

Source§

fn default() -> SmartArtRef

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V