pub struct ZipReader<R: Read + Seek> { /* private fields */ }Expand description
ZIP文档读取器
Implementations§
Source§impl<R: Read + Seek> ZipReader<R>
impl<R: Read + Seek> ZipReader<R>
Sourcepub fn new_with_config(reader: R, config: ZipSecurityConfig) -> Result<Self>
pub fn new_with_config(reader: R, config: ZipSecurityConfig) -> Result<Self>
创建新的ZIP读取器(使用自定义安全配置)
Sourcepub fn contains_file(&self, name: &str) -> bool
pub fn contains_file(&self, name: &str) -> bool
检查文件是否存在
Sourcepub fn read_file_to_string(&mut self, name: &str) -> Result<String>
pub fn read_file_to_string(&mut self, name: &str) -> Result<String>
读取文件内容为字符串
Sourcepub fn extract_file<P: AsRef<Path>>(
&mut self,
name: &str,
output_path: P,
) -> Result<()>
pub fn extract_file<P: AsRef<Path>>( &mut self, name: &str, output_path: P, ) -> Result<()>
提取文件到指定路径
Sourcepub fn list_files_in_directory(&self, dir_path: &str) -> Vec<&ZipEntry>
pub fn list_files_in_directory(&self, dir_path: &str) -> Vec<&ZipEntry>
列出指定目录下的文件
Sourcepub fn find_files(&self, pattern: &str) -> Vec<&ZipEntry>
pub fn find_files(&self, pattern: &str) -> Vec<&ZipEntry>
查找匹配模式的文件
Auto Trait Implementations§
impl<R> Freeze for ZipReader<R>where
R: Freeze,
impl<R> RefUnwindSafe for ZipReader<R>where
R: RefUnwindSafe,
impl<R> Send for ZipReader<R>where
R: Send,
impl<R> Sync for ZipReader<R>where
R: Sync,
impl<R> Unpin for ZipReader<R>where
R: Unpin,
impl<R> UnsafeUnpin for ZipReader<R>where
R: UnsafeUnpin,
impl<R> UnwindSafe for ZipReader<R>where
R: UnwindSafe,
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