Enum ZipError
#[non_exhaustive]
pub enum ZipError
Error type for Zip
Variants
-
Io(Error) i/o error
-
InvalidArchive(Cow<'static, str>) invalid Zip archive
-
UnsupportedArchive(&'static str) unsupported Zip archive
-
FileNotFound specified file not found in archive
-
InvalidPassword provided password is incorrect
-
CompressionMethodNotSupported(u16) Compression method not supported
-
DecompressedSizeLimitExceeded { size: u128, limit: u64 } Declared uncompressed size is above the limit passed to
ExtractOptions::size_limit.-
DecompressedSizeUnknown A size limit was requested, but
ZipArchive::decompressed_sizeisNone. That happens when an entry uses a data descriptor, or when the sum of the declared sizes overflows.
Implementations
impl ZipError
const PASSWORD_REQUIRED: &'static str = "Password required to decrypt file";The text used as an error when a password is required and not supplied
# use zip::result::ZipError; # let mut archive = zip::ZipArchive::new(std::io::Cursor::new(&[])).unwrap(); match archive.by_index(1) { Err(ZipError::UnsupportedArchive(ZipError::PASSWORD_REQUIRED)) => eprintln!("a password is needed to unzip this file"), _ => (), } # ()
Trait Implementations
impl Clone for ZipError
fn clone(&self) -> Self
impl Debug for ZipError
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl Display for ZipError
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl Error for ZipError
fn source(&self) -> Option<&dyn Error + 'static>
impl From<DateTimeRangeError> for ZipError
fn from(DateTimeRangeError) -> Self
impl From<Error> for ZipError
fn from(value: Error) -> Self
impl From<FromUtf8Error> for ZipError
fn from(FromUtf8Error) -> Self