pub enum ZipSource {
Path(PathBuf),
Bytes(Arc<Vec<u8>>),
}Expand description
xlsx 数据来源:磁盘文件或内存字节(可克隆,克隆体共享同一份数据)
Variants§
Implementations§
Source§impl ZipSource
impl ZipSource
Sourcepub fn from_bytes(bytes: Vec<u8>) -> Self
pub fn from_bytes(bytes: Vec<u8>) -> Self
以内存字节为数据源
pub fn from_arc(bytes: Arc<Vec<u8>>) -> Self
pub fn path(&self) -> Option<&Path>
pub fn len(&self) -> u64
pub fn is_empty(&self) -> bool
Sourcepub fn open_archive(&self) -> Result<ZipArchive<BoxedReader>>
pub fn open_archive(&self) -> Result<ZipArchive<BoxedReader>>
打开一个 zip 归档句柄(互不影响,可同时持有多份用于并发读取)
Sourcepub fn entry_names(&self) -> Result<Vec<String>>
pub fn entry_names(&self) -> Result<Vec<String>>
条目名列表(兼容性探测 / 调试用)
Sourcepub fn entry_meta(&self, name: &str) -> Result<EntryMeta>
pub fn entry_meta(&self, name: &str) -> Result<EntryMeta>
取条目元信息
Sourcepub fn open_entry_reader(&self, meta: &EntryMeta) -> Result<EntryReader>
pub fn open_entry_reader(&self, meta: &EntryMeta) -> Result<EntryReader>
按元信息打开一个独占所有权的条目读取器(无借用,可长期持有)
Sourcepub fn entry_reader(&self, name: &str) -> Result<EntryReader>
pub fn entry_reader(&self, name: &str) -> Result<EntryReader>
一步到位:按条目名打开流式读取器
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ZipSource
impl RefUnwindSafe for ZipSource
impl Send for ZipSource
impl Sync for ZipSource
impl Unpin for ZipSource
impl UnsafeUnpin for ZipSource
impl UnwindSafe for ZipSource
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