pub struct Archive { /* private fields */ }Expand description
A parsed archive: central directory in memory, entry data on demand.
Implementations§
Source§impl Archive
impl Archive
Sourcepub fn from_bytes(bytes: Vec<u8>) -> Result<Self>
pub fn from_bytes(bytes: Vec<u8>) -> Result<Self>
Opens an archive held entirely in memory.
pub fn source(&self) -> &Arc<dyn Source> ⓘ
pub fn entries(&self) -> &[Entry]
pub fn get(&self, index: usize) -> Option<&Entry>
Sourcepub fn duplicates(&self) -> &[usize]
pub fn duplicates(&self) -> &[usize]
Indexes of entries whose name repeats an earlier entry’s name.
pub fn layout(&self) -> &Layout
Sourcepub fn local_header(&self, entry: &Entry) -> Result<LocalHeader>
pub fn local_header(&self, entry: &Entry) -> Result<LocalHeader>
Reads and checks the local header of entry.
Sourcepub fn read_raw(&self, entry: &Entry, out: &mut Vec<u8>) -> Result<()>
pub fn read_raw(&self, entry: &Entry, out: &mut Vec<u8>) -> Result<()>
Reads the compressed bytes of entry into out (cleared first).
Sourcepub fn read(&self, entry: &Entry, out: &mut Vec<u8>) -> Result<()>
pub fn read(&self, entry: &Entry, out: &mut Vec<u8>) -> Result<()>
Reads and decompresses entry into out (cleared first).
pub fn read_to_vec(&self, entry: &Entry) -> Result<Vec<u8>>
Sourcepub fn crc_matches(entry: &Entry, data: &[u8]) -> bool
pub fn crc_matches(entry: &Entry, data: &[u8]) -> bool
Whether data (the decompressed bytes) matches the recorded CRC-32.
Auto Trait Implementations§
impl !RefUnwindSafe for Archive
impl !UnwindSafe for Archive
impl Freeze for Archive
impl Send for Archive
impl Sync for Archive
impl Unpin for Archive
impl UnsafeUnpin 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