pub struct ResourceItem {
pub id: String,
pub resource_type: ResourceType,
pub file_path: Option<String>,
pub format: Option<String>,
}Expand description
资源条目,描述文档中一个被引用的资源。
对应 Java: org.ofdrw.core.basicStructure.res.CT_MultiMedia(简化版)
Fields§
§id: String资源 ID(文档内唯一)。
resource_type: ResourceType资源类型。
file_path: Option<String>资源文件在容器内的路径(相对于文档目录)。
format: Option<String>资源文件格式(如 “PNG”、“JPEG”、“TTF”)。
Implementations§
Source§impl ResourceItem
impl ResourceItem
Sourcepub fn new(id: impl Into<String>, resource_type: ResourceType) -> Self
pub fn new(id: impl Into<String>, resource_type: ResourceType) -> Self
创建新的资源条目。
Sourcepub fn with_file_path(self, path: impl Into<String>) -> Self
pub fn with_file_path(self, path: impl Into<String>) -> Self
设置资源文件路径。
Sourcepub fn with_format(self, format: impl Into<String>) -> Self
pub fn with_format(self, format: impl Into<String>) -> Self
设置资源格式。
Trait Implementations§
Source§impl Clone for ResourceItem
impl Clone for ResourceItem
Source§fn clone(&self) -> ResourceItem
fn clone(&self) -> ResourceItem
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 moreAuto Trait Implementations§
impl Freeze for ResourceItem
impl RefUnwindSafe for ResourceItem
impl Send for ResourceItem
impl Sync for ResourceItem
impl Unpin for ResourceItem
impl UnsafeUnpin for ResourceItem
impl UnwindSafe for ResourceItem
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