#[non_exhaustive]pub enum ZiPatchError {
Show 13 variants
Io(Error),
InvalidMagic,
UnknownChunkTag([u8; 4]),
UnknownSqpkCommand(u8),
ChecksumMismatch {
tag: [u8; 4],
expected: u32,
actual: u32,
},
Decompress(Error),
InvalidField {
context: &'static str,
},
OversizedChunk(usize),
UnknownFileOperation(u8),
Utf8Error(FromUtf8Error),
BinrwError(Error),
NegativeFileOffset(i64),
TruncatedPatch,
}Expand description
All failures returned by parsing or applying a ZiPatch stream.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Io(Error)
Underlying I/O failure from the patch source or target filesystem.
InvalidMagic
The 12-byte ZiPatch magic header was missing or did not match.
UnknownChunkTag([u8; 4])
A 4-byte chunk tag was not recognised by the parser.
UnknownSqpkCommand(u8)
A SQPK sub-command byte was not recognised by the parser.
ChecksumMismatch
A chunk’s recorded CRC32 did not match the computed CRC32.
Fields
Decompress(Error)
DEFLATE decompression of a SqpkFile block failed.
InvalidField
A field value failed a parser invariant (e.g. negative size).
OversizedChunk(usize)
A chunk declared a size larger than the parser’s maximum.
UnknownFileOperation(u8)
A SqpkFile operation byte was not recognised.
Utf8Error(FromUtf8Error)
A UTF-8 decode failed when reading a path or name field.
BinrwError(Error)
A binrw parser produced an error; wraps the underlying cause.
NegativeFileOffset(i64)
A SqpkFile carried a negative file_offset that cannot be applied.
TruncatedPatch
Stream ended without an EOF_ chunk; download or copy was truncated.
Trait Implementations§
Source§impl Debug for ZiPatchError
impl Debug for ZiPatchError
Source§impl Display for ZiPatchError
impl Display for ZiPatchError
Source§impl Error for ZiPatchError
impl Error for ZiPatchError
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()