Skip to main content

DeltaError

Enum DeltaError 

Source
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

§opcode: u8

The encoding opcode being decoded.

§needed: usize

Minimum bytes the format requires at this point.

§got: usize

Bytes actually available.

§

InvalidInstruction(u8)

An instruction byte inside a 0x02 stream is not 0x01/0x02.

§

CopyOutOfRange

A Copy instruction referenced bytes outside the base.

Fields

§base_offset: u64

Declared start offset into the base.

§length: u32

Declared copy length.

§base_len: usize

Actual base length.

§

InsertOutOfRange

An Insert instruction declared more data than the delta holds.

Fields

§declared: u32

Declared insert length.

§remaining: usize

Bytes remaining in the delta.

§

TargetLengthMismatch

The reconstructed output did not match the declared target length.

Fields

§side: MismatchSide

Which declared length was contradicted.

§declared: usize

The length declared in the delta.

§reconstructed: usize

The length actually reconstructed.

§

ChecksumMismatch

A blake3 prefix checksum of a 0x03 binary delta did not match.

Fields

§side: MismatchSide

Which 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

Source§

fn clone(&self) -> DeltaError

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DeltaError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for DeltaError

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for DeltaError

Source§

impl Error for DeltaError

1.30.0 · Source§

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

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl PartialEq for DeltaError

Source§

fn eq(&self, other: &DeltaError) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for DeltaError

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.