pub struct Archive {
pub blocks: Vec<Block>,
pub files: Vec<ArchiveEntry>,
pub stream_map: StreamMap,
pub is_solid: bool,
/* private fields */
}Fields§
§blocks: Vec<Block>§files: Vec<ArchiveEntry>§stream_map: StreamMap§is_solid: boolImplementations§
Source§impl Archive
impl Archive
Sourcepub fn open(path: impl AsRef<Path>) -> Result<Archive, Error>
pub fn open(path: impl AsRef<Path>) -> Result<Archive, Error>
Open 7z file under specified path.
Sourcepub fn open_with_password(
path: impl AsRef<Path>,
password: &Password,
) -> Result<Archive, Error>
pub fn open_with_password( path: impl AsRef<Path>, password: &Password, ) -> Result<Archive, Error>
Open an encrypted 7z file under specified path with password.
Sourcepub fn read<R: Read + Seek>(
reader: &mut R,
password: &Password,
) -> Result<Archive, Error>
pub fn read<R: Read + Seek>( reader: &mut R, password: &Password, ) -> Result<Archive, Error>
Read 7z file archive info use the specified reader.
§Parameters
reader- the reader of the 7z filr archivepassword- archive password encoded in utf16 little endian
§Example
use std::{
fs::File,
io::{Read, Seek},
};
use sevenz_rust2::*;
let mut reader = File::open("example.7z").unwrap();
let password = Password::from("the password");
let archive = Archive::read(&mut reader, &password).unwrap();
for entry in &archive.files {
println!("{}", entry.name());
}Trait Implementations§
Auto Trait Implementations§
impl Freeze for Archive
impl RefUnwindSafe for Archive
impl Send for Archive
impl Sync for Archive
impl Unpin for Archive
impl UnwindSafe for Archive
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