pub enum ArchiveError {
Io(Error),
UnsupportedFormat(String),
InvalidHeader {
format: String,
},
CorruptedEntry {
format: String,
entry_name: String,
reason: String,
},
IndexMismatch(String),
CrcMismatch {
entry: String,
expected: u32,
actual: u32,
},
DecompressionFailed {
entry: String,
reason: String,
},
UnsupportedMethod {
format: String,
method: String,
},
PasswordRequired {
path: PathBuf,
},
ExternalLibrary {
library: String,
message: String,
},
}Expand description
Error type for archive operations
Variants§
Io(Error)
IO error during archive operations
UnsupportedFormat(String)
Unsupported archive format
InvalidHeader
Invalid archive header
CorruptedEntry
Corrupted archive entry
Fields
IndexMismatch(String)
Entry index mismatch
CrcMismatch
CRC checksum mismatch
Fields
DecompressionFailed
Decompression failed
Fields
UnsupportedMethod
Unsupported compression method
PasswordRequired
Password required but not provided
ExternalLibrary
External library error (e.g., from zip, unrar, sevenz-rust2)
Implementations§
Source§impl ArchiveError
impl ArchiveError
Sourcepub fn unsupported_format(path: impl Into<String>) -> Self
pub fn unsupported_format(path: impl Into<String>) -> Self
Create an unsupported format error
Sourcepub fn invalid_header(format: impl Into<String>) -> Self
pub fn invalid_header(format: impl Into<String>) -> Self
Create an invalid header error
Sourcepub fn corrupted_entry(
format: impl Into<String>,
reason: impl Into<String>,
) -> Self
pub fn corrupted_entry( format: impl Into<String>, reason: impl Into<String>, ) -> Self
Create a corrupted entry error
Sourcepub fn corrupted_entry_named(
format: impl Into<String>,
entry_name: impl Into<String>,
reason: impl Into<String>,
) -> Self
pub fn corrupted_entry_named( format: impl Into<String>, entry_name: impl Into<String>, reason: impl Into<String>, ) -> Self
Create a corrupted entry error with entry name
Sourcepub fn crc_mismatch(
entry: impl Into<String>,
expected: u32,
actual: u32,
) -> Self
pub fn crc_mismatch( entry: impl Into<String>, expected: u32, actual: u32, ) -> Self
Create a CRC mismatch error
Sourcepub fn decompression_failed(
entry: impl Into<String>,
reason: impl Into<String>,
) -> Self
pub fn decompression_failed( entry: impl Into<String>, reason: impl Into<String>, ) -> Self
Create a decompression failed error
Trait Implementations§
Source§impl Debug for ArchiveError
impl Debug for ArchiveError
Source§impl Display for ArchiveError
impl Display for ArchiveError
Source§impl Error for ArchiveError
impl Error for ArchiveError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl From<ArchiveError> for Error
impl From<ArchiveError> for Error
Source§fn from(err: ArchiveError) -> Self
fn from(err: ArchiveError) -> Self
Converts to this type from the input type.
Source§impl From<Error> for ArchiveError
impl From<Error> for ArchiveError
Source§impl<T: Read> From<LhaDecodeError<T>> for ArchiveError
impl<T: Read> From<LhaDecodeError<T>> for ArchiveError
Source§fn from(err: LhaDecodeError<T>) -> Self
fn from(err: LhaDecodeError<T>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for ArchiveError
impl !RefUnwindSafe for ArchiveError
impl Send for ArchiveError
impl Sync for ArchiveError
impl Unpin for ArchiveError
impl !UnwindSafe for ArchiveError
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
Mutably borrows from an owned value. Read more