pub struct CT_PageBlock {
pub page_blocks: Vec<CT_PageBlock>,
pub text_objects: Vec<PageBlockTextObject>,
pub path_objects: Vec<PageBlockPathObject>,
pub image_objects: Vec<PageBlockImageObject>,
}Expand description
对应 Java: org.ofdrw.core.basicStructure.pageObj.layer.block.CT_PageBlock
页面块容器,可以嵌套。用于组织页面内容,支持包含文本对象、 图像对象、路径对象以及嵌套的页面块。 对应 GB/T 33190-2016 第 7.7 节图 17 表 16。
Fields§
§page_blocks: Vec<CT_PageBlock>嵌套的页面块列表。
text_objects: Vec<PageBlockTextObject>文本对象列表。
path_objects: Vec<PageBlockPathObject>路径对象列表。
image_objects: Vec<PageBlockImageObject>图像对象列表。
Implementations§
Source§impl CT_PageBlock
impl CT_PageBlock
Sourcepub fn add_page_block(&mut self, block: CT_PageBlock)
pub fn add_page_block(&mut self, block: CT_PageBlock)
添加嵌套页面块。
Sourcepub fn add_text_object(&mut self, obj: PageBlockTextObject)
pub fn add_text_object(&mut self, obj: PageBlockTextObject)
添加文本对象。
Sourcepub fn add_path_object(&mut self, obj: PageBlockPathObject)
pub fn add_path_object(&mut self, obj: PageBlockPathObject)
添加路径对象。
Sourcepub fn add_image_object(&mut self, obj: PageBlockImageObject)
pub fn add_image_object(&mut self, obj: PageBlockImageObject)
添加图像对象。
Sourcepub fn get_page_blocks(&self) -> &[CT_PageBlock]
pub fn get_page_blocks(&self) -> &[CT_PageBlock]
获取所有嵌套页面块。
Sourcepub fn total_count(&self) -> usize
pub fn total_count(&self) -> usize
子元素总数(递归统计)。
Sourcepub fn to_xml_string(&self) -> String
pub fn to_xml_string(&self) -> String
序列化为 OFD XML 字符串。
Trait Implementations§
Source§impl Clone for CT_PageBlock
impl Clone for CT_PageBlock
Source§fn clone(&self) -> CT_PageBlock
fn clone(&self) -> CT_PageBlock
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 CT_PageBlock
impl Debug for CT_PageBlock
Source§impl Default for CT_PageBlock
impl Default for CT_PageBlock
Source§impl XmlElement for CT_PageBlock
impl XmlElement for CT_PageBlock
Source§fn element_name(&self) -> &'static str
fn element_name(&self) -> &'static str
对应 Java: org.ofdrw.core.basicStructure.pageObj.layer.block.CT_PageBlock
Source§fn child_nodes(&self) -> Vec<XmlNode>
fn child_nodes(&self) -> Vec<XmlNode>
子元素(作为
XmlNode 提供,便于嵌套序列化)。Source§fn from_xml(node: &XmlNode) -> Result<Self, XmlElementError>
fn from_xml(node: &XmlNode) -> Result<Self, XmlElementError>
从节点树解析(对应 ofdrw 解析侧;quick-xml 产物)。 Read more
Source§fn text_content(&self) -> Option<&str>
fn text_content(&self) -> Option<&str>
文本内容(简单文本元素)。
Auto Trait Implementations§
impl Freeze for CT_PageBlock
impl RefUnwindSafe for CT_PageBlock
impl Send for CT_PageBlock
impl Sync for CT_PageBlock
impl Unpin for CT_PageBlock
impl UnsafeUnpin for CT_PageBlock
impl UnwindSafe for CT_PageBlock
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