pub struct IndexedZip { /* private fields */ }Implementations§
Methods from Deref<Target = ZipArchive<BufReader<File>>>§
Sourcepub fn extract<P>(&mut self, directory: P) -> Result<(), ZipError>
pub fn extract<P>(&mut self, directory: P) -> Result<(), ZipError>
Extract a Zip archive into a directory, overwriting files if they
already exist. Paths are sanitized with ZipFile::enclosed_name.
Extraction is not atomic; If an error is encountered, some of the files may be left on disk.
Sourcepub fn offset(&self) -> u64
pub fn offset(&self) -> u64
Get the offset from the beginning of the underlying reader that this zip begins at, in bytes.
Normally this value is zero, but if the zip has arbitrary data prepended to it, then this value will be the size of that prepended data.
Sourcepub fn file_names(&self) -> impl Iterator<Item = &str>
pub fn file_names(&self) -> impl Iterator<Item = &str>
Returns an iterator over all the file and directory names in this archive.
Sourcepub fn by_name_decrypt<'a>(
&'a mut self,
name: &str,
password: &[u8],
) -> Result<Result<ZipFile<'a>, InvalidPassword>, ZipError>
pub fn by_name_decrypt<'a>( &'a mut self, name: &str, password: &[u8], ) -> Result<Result<ZipFile<'a>, InvalidPassword>, ZipError>
Search for a file entry by name, decrypt with given password
§Warning
The implementation of the cryptographic algorithms has not gone through a correctness review, and you should assume it is insecure: passwords used with this API may be compromised.
This function sometimes accepts wrong password. This is because the ZIP spec only allows us to check for a 1/256 chance that the password is correct. There are many passwords out there that will also pass the validity checks we are able to perform. This is a weakness of the ZipCrypto algorithm, due to its fairly primitive approach to cryptography.
Sourcepub fn by_name<'a>(&'a mut self, name: &str) -> Result<ZipFile<'a>, ZipError>
pub fn by_name<'a>(&'a mut self, name: &str) -> Result<ZipFile<'a>, ZipError>
Search for a file entry by name
Sourcepub fn by_index_decrypt<'a>(
&'a mut self,
file_number: usize,
password: &[u8],
) -> Result<Result<ZipFile<'a>, InvalidPassword>, ZipError>
pub fn by_index_decrypt<'a>( &'a mut self, file_number: usize, password: &[u8], ) -> Result<Result<ZipFile<'a>, InvalidPassword>, ZipError>
Get a contained file by index, decrypt with given password
§Warning
The implementation of the cryptographic algorithms has not gone through a correctness review, and you should assume it is insecure: passwords used with this API may be compromised.
This function sometimes accepts wrong password. This is because the ZIP spec only allows us to check for a 1/256 chance that the password is correct. There are many passwords out there that will also pass the validity checks we are able to perform. This is a weakness of the ZipCrypto algorithm, due to its fairly primitive approach to cryptography.
Trait Implementations§
Source§impl Debug for IndexedZip
impl Debug for IndexedZip
Source§impl Deref for IndexedZip
impl Deref for IndexedZip
Source§impl DerefMut for IndexedZip
impl DerefMut for IndexedZip
Source§impl<'z> IntoIterator for &'z IndexedZip
impl<'z> IntoIterator for &'z IndexedZip
Source§type IntoIter = Box<dyn Iterator<Item = <&'z IndexedZip as IntoIterator>::Item> + 'z>
type IntoIter = Box<dyn Iterator<Item = <&'z IndexedZip as IntoIterator>::Item> + 'z>
Source§fn into_iter(self) -> <&'z IndexedZip as IntoIterator>::IntoIter
fn into_iter(self) -> <&'z IndexedZip as IntoIterator>::IntoIter
Auto Trait Implementations§
impl Freeze for IndexedZip
impl RefUnwindSafe for IndexedZip
impl Send for IndexedZip
impl Sync for IndexedZip
impl Unpin for IndexedZip
impl UnsafeUnpin for IndexedZip
impl UnwindSafe for IndexedZip
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<A> DynCastExt for A
impl<A> DynCastExt for A
Source§fn dyn_cast<T>(
self,
) -> Result<<A as DynCastExtHelper<T>>::Target, <A as DynCastExtHelper<T>>::Source>where
A: DynCastExtHelper<T>,
T: ?Sized,
fn dyn_cast<T>(
self,
) -> Result<<A as DynCastExtHelper<T>>::Target, <A as DynCastExtHelper<T>>::Source>where
A: DynCastExtHelper<T>,
T: ?Sized,
Source§fn dyn_upcast<T>(self) -> <A as DynCastExtAdvHelper<T, T>>::Target
fn dyn_upcast<T>(self) -> <A as DynCastExtAdvHelper<T, T>>::Target
Source§fn dyn_cast_adv<F, T>(
self,
) -> Result<<A as DynCastExtAdvHelper<F, T>>::Target, <A as DynCastExtAdvHelper<F, T>>::Source>
fn dyn_cast_adv<F, T>( self, ) -> Result<<A as DynCastExtAdvHelper<F, T>>::Target, <A as DynCastExtAdvHelper<F, T>>::Source>
Source§fn dyn_cast_with_config<C>(
self,
) -> Result<<A as DynCastExtAdvHelper<<C as DynCastConfig>::Source, <C as DynCastConfig>::Target>>::Target, <A as DynCastExtAdvHelper<<C as DynCastConfig>::Source, <C as DynCastConfig>::Target>>::Source>where
C: DynCastConfig,
A: DynCastExtAdvHelper<<C as DynCastConfig>::Source, <C as DynCastConfig>::Target>,
fn dyn_cast_with_config<C>(
self,
) -> Result<<A as DynCastExtAdvHelper<<C as DynCastConfig>::Source, <C as DynCastConfig>::Target>>::Target, <A as DynCastExtAdvHelper<<C as DynCastConfig>::Source, <C as DynCastConfig>::Target>>::Source>where
C: DynCastConfig,
A: DynCastExtAdvHelper<<C as DynCastConfig>::Source, <C as DynCastConfig>::Target>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more