#[non_exhaustive]pub enum PasswordDetectionMethod {
EarlyHeaderValidation,
CrcMismatch,
DecompressionFailure,
}Expand description
How a wrong password was detected.
This enum indicates the method used to detect that an incorrect password
was provided for an encrypted archive. Use Error::PasswordRequired instead
when no password was provided at all.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
EarlyHeaderValidation
Detected early by checking if decrypted data looks like valid compression headers.
This is the fastest detection method as it only requires decrypting and examining the first block of data. It works by checking if the decrypted bytes form valid LZMA/LZMA2/Deflate/etc. header patterns.
CrcMismatch
Detected after decompression via CRC-32 mismatch.
This method requires full decompression of the entry before the wrong password can be detected. It’s slower but catches cases where early detection isn’t possible (e.g., encrypted-only data without compression).
DecompressionFailure
Detected due to decompression failure.
The decrypted data caused the decompressor to fail, which typically indicates garbage data from a wrong password.
Trait Implementations§
Source§impl Clone for PasswordDetectionMethod
impl Clone for PasswordDetectionMethod
Source§fn clone(&self) -> PasswordDetectionMethod
fn clone(&self) -> PasswordDetectionMethod
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PasswordDetectionMethod
impl Debug for PasswordDetectionMethod
Source§impl Display for PasswordDetectionMethod
impl Display for PasswordDetectionMethod
Source§impl PartialEq for PasswordDetectionMethod
impl PartialEq for PasswordDetectionMethod
impl Copy for PasswordDetectionMethod
impl Eq for PasswordDetectionMethod
impl StructuralPartialEq for PasswordDetectionMethod
Auto Trait Implementations§
impl Freeze for PasswordDetectionMethod
impl RefUnwindSafe for PasswordDetectionMethod
impl Send for PasswordDetectionMethod
impl Sync for PasswordDetectionMethod
impl Unpin for PasswordDetectionMethod
impl UnwindSafe for PasswordDetectionMethod
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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