pub enum DeltaError {
Empty,
InvalidOpcode(u8),
Truncated {
opcode: u8,
needed: usize,
got: usize,
},
InvalidInstruction(u8),
CopyOutOfRange {
base_offset: u64,
length: u32,
base_len: usize,
},
InsertOutOfRange {
declared: u32,
remaining: usize,
},
TargetLengthMismatch {
side: MismatchSide,
declared: usize,
reconstructed: usize,
},
ChecksumMismatch {
side: MismatchSide,
},
Decompression(String),
ZstdDisabled,
}Expand description
Errors produced while applying a delta.
compute_delta is total and cannot fail; only apply_delta validates.
Variants§
Empty
The delta was empty (no opcode byte).
InvalidOpcode(u8)
The top-level opcode is not one of 0x00..=0x03.
Truncated
A header or record ended before the format requires.
Fields
InvalidInstruction(u8)
An instruction byte inside a 0x02 stream is not 0x01/0x02.
CopyOutOfRange
A Copy instruction referenced bytes outside the base.
Fields
InsertOutOfRange
An Insert instruction declared more data than the delta holds.
TargetLengthMismatch
The reconstructed output did not match the declared target length.
Fields
side: MismatchSideWhich declared length was contradicted.
ChecksumMismatch
A blake3 prefix checksum of a 0x03 binary delta did not match.
Fields
side: MismatchSideWhich half failed (base or reconstructed target).
Decompression(String)
The embedded Zstd frame failed to decompress.
ZstdDisabled
A 0x03 binary delta was received by a build compiled without the
zstd feature; it cannot be decoded.
Trait Implementations§
Source§impl Clone for DeltaError
impl Clone for DeltaError
Source§fn clone(&self) -> DeltaError
fn clone(&self) -> DeltaError
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 DeltaError
impl Debug for DeltaError
Source§impl Display for DeltaError
impl Display for DeltaError
impl Eq for DeltaError
Source§impl Error for DeltaError
impl Error for DeltaError
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()