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_size is None. 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

Auto Trait Implementations

impl !RefUnwindSafe for ZipError

impl !UnwindSafe for ZipError

impl Freeze for ZipError

impl Send for ZipError

impl Sync for ZipError

impl Unpin for ZipError

impl UnsafeUnpin for ZipError

Blanket Implementations

impl<T> Any for ZipError where T: 'static + ?Sized,

impl<T> Borrow<T> for ZipError where T: ?Sized,

impl<T> BorrowMut<T> for ZipError where T: ?Sized,

impl<T> CloneToUninit for ZipError where T: Clone,

impl<T> From<T> for ZipError

impl<T> Same for ZipError

impl<T> ToOwned for ZipError where T: Clone,

impl<T> ToString for ZipError where T: Display + ?Sized,

impl<T, U> Into<U> for ZipError where U: From<T>,

impl<T, U> TryFrom<U> for ZipError where U: Into<T>,

impl<T, U> TryInto<U> for ZipError where U: TryFrom<T>,