#[non_exhaustive]pub enum EncryptionError {
NeedPassword,
WrongPassword,
NotDecryptable(String),
Malformed(String),
}Expand description
Why an encrypted document could not be opened.
Only NeedPassword and
WrongPassword are solved by a password
(needs_password); the other two say the file
cannot be read however it is asked. Non-exhaustive: a reader may learn to
tell another case apart.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
NeedPassword
No password was given and none the reader tries by itself (a format’s documented default) opens the document.
WrongPassword
A password was given and neither it nor a default one opens it.
NotDecryptable(String)
The document is encrypted in a way this reader does not decrypt (ODF package encryption, XOR obfuscation, an iWork package, a WordPerfect file, an unknown cipher), so no password would help. The payload names the scheme.
Malformed(String)
The document is encrypted, but its encryption header is damaged or outside the specification’s bounds. The payload names the field.
Implementations§
Source§impl EncryptionError
impl EncryptionError
Sourcepub fn needs_password(&self) -> bool
pub fn needs_password(&self) -> bool
Whether a (different) password would open the document — the two cases worth prompting a user for.
Trait Implementations§
Source§impl Clone for EncryptionError
impl Clone for EncryptionError
Source§fn clone(&self) -> EncryptionError
fn clone(&self) -> EncryptionError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for EncryptionError
impl Debug for EncryptionError
Source§impl Display for EncryptionError
impl Display for EncryptionError
impl Eq for EncryptionError
Source§impl Error for EncryptionError
impl Error for EncryptionError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl PartialEq for EncryptionError
impl PartialEq for EncryptionError
impl StructuralPartialEq for EncryptionError
Auto Trait Implementations§
impl Freeze for EncryptionError
impl RefUnwindSafe for EncryptionError
impl Send for EncryptionError
impl Sync for EncryptionError
impl Unpin for EncryptionError
impl UnsafeUnpin for EncryptionError
impl UnwindSafe for EncryptionError
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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§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