pub struct CT_Attachment {
pub id: String,
pub name: String,
pub format: Option<String>,
pub creation_date: Option<String>,
pub size: Option<u64>,
pub visible: bool,
pub file: Option<String>,
}Expand description
附件。
对应 Java: org.ofdrw.core.attachment.CT_Attachment
等价于 crate::attachment::CTAttachment。
对应 Java: org.ofdrw.core.attachment.CT_Attachment
表示一个单独的附件对象,包含附件的标识、名称、格式、 创建日期、大小、可见性和文件数据。
Fields§
§id: String附件 ID。
name: String附件名称。
format: Option<String>附件格式(MIME 类型或文件扩展名)。
creation_date: Option<String>创建日期(ISO 8601 格式字符串)。
size: Option<u64>附件大小(字节)。
visible: bool附件是否可见。
file: Option<String>附件文件路径(OFD 包内相对路径)。
Implementations§
Source§impl CTAttachment
impl CTAttachment
Sourcepub fn creation_date(self, date: impl Into<String>) -> Self
pub fn creation_date(self, date: impl Into<String>) -> Self
设置创建日期。
Sourcepub fn to_xml_string(&self) -> String
pub fn to_xml_string(&self) -> String
序列化为 XML 字符串。
Trait Implementations§
Source§impl Clone for CTAttachment
impl Clone for CTAttachment
Source§fn clone(&self) -> CTAttachment
fn clone(&self) -> CTAttachment
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 CTAttachment
impl Debug for CTAttachment
Source§impl PartialEq for CTAttachment
impl PartialEq for CTAttachment
impl StructuralPartialEq for CTAttachment
Source§impl XmlElement for CTAttachment
impl XmlElement for CTAttachment
Source§fn element_name(&self) -> &'static str
fn element_name(&self) -> &'static str
对应 Java: org.ofdrw.core.attachment.CT_Attachment
Source§fn from_xml(node: &XmlNode) -> Result<Self, XmlElementError>
fn from_xml(node: &XmlNode) -> Result<Self, XmlElementError>
从节点树解析(对应 ofdrw 解析侧;quick-xml 产物)。 Read more
Source§fn child_nodes(&self) -> Vec<XmlNode>
fn child_nodes(&self) -> Vec<XmlNode>
子元素(作为
XmlNode 提供,便于嵌套序列化)。Source§fn text_content(&self) -> Option<&str>
fn text_content(&self) -> Option<&str>
文本内容(简单文本元素)。
Auto Trait Implementations§
impl Freeze for CTAttachment
impl RefUnwindSafe for CTAttachment
impl Send for CTAttachment
impl Sync for CTAttachment
impl Unpin for CTAttachment
impl UnsafeUnpin for CTAttachment
impl UnwindSafe for CTAttachment
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