Struct archive_reader::Entry
source · pub struct Entry { /* private fields */ }Expand description
Entry represents a file / dir in an archive.
Safety
Try not to keep entry objects! Entry has pointers pointing to the bytes in the archive. Every call on Entries::next will disable the pointers, and it is undefined behaviour to use the functions while the Entry is not pointing to the newest entry.
Implementations§
source§impl Entry
impl Entry
sourcepub unsafe fn file_name<F>(&self, decode: F) -> Result<Cow<'_, str>>where
F: FnOnce(&[u8]) -> Option<Cow<'_, str>>,
pub unsafe fn file_name<F>(&self, decode: F) -> Result<Cow<'_, str>>where F: FnOnce(&[u8]) -> Option<Cow<'_, str>>,
file_name returns the name of the entry decoded with the provided decoder.
It may fail if the decoder cannot decode the name.
Safety
Make sure the Entries::next has not been called again before calling. Calling this function while Entry is not pointing to the newest entry contains UB.
sourcepub unsafe fn read_file_by_block(
self
) -> impl Iterator<Item = Result<Box<[u8]>>> + Send
pub unsafe fn read_file_by_block( self ) -> impl Iterator<Item = Result<Box<[u8]>>> + Send
read_file_by_block returns an iterator of the entry content blocks.
Safety
Make sure the Entries::next has not been called again before calling. Calling this function while Entry is not pointing to the newest entry contains UB.