#[non_exhaustive]pub enum PartSource {
Patch {
patch_idx: u32,
offset: u64,
kind: PatchSourceKind,
decoded_skip: u16,
},
Zeros,
EmptyBlock {
units: u32,
},
Unavailable,
}Expand description
Where a Region’s bytes come from.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Patch
Bytes live in the source patch file at Plan::patches[patch_idx].
offset is absolute within that patch file, not chunk-relative —
the builder has already added the chunk’s body position. kind selects
raw vs DEFLATE-encoded.
Fields
patch_idx: u32Index into Plan::patches selecting which patch file holds the bytes.
kind: PatchSourceKindHow the source bytes are encoded at that offset.
decoded_skip: u16For PatchSourceKind::Deflated sources only: bytes to skip in the
decompressed output before writing this region. Always 0 for
PatchSourceKind::Raw. Used when a single DEFLATE block is split
across two regions by a cross-patch overlap — both halves share
(patch_idx, offset, kind) but slice the decompressed output differently.
Zeros
Region is a run of zero bytes (e.g. an SqpkAddData block_delete_number
trailing zero-fill).
EmptyBlock
Region is the canonical SqPack empty-block payload covering units
128-byte blocks (SqpkDeleteData / SqpkExpandData).
Region exists in the plan but its source bytes are not reachable from
the PatchSource the applier will be given. The builder does not
emit this variant from any in-tree chunk parser; it is provided for
hand-constructed plans (or deserialized plans) that intentionally name
a region without backing bytes. crate::index::IndexApplier::execute
surfaces these as
crate::ZiPatchError::IndexSourceUnavailable, and
crate::index::Verifier always flags them as needing repair.
Trait Implementations§
Source§impl Clone for PartSource
impl Clone for PartSource
Source§fn clone(&self) -> PartSource
fn clone(&self) -> PartSource
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 PartSource
impl Debug for PartSource
Source§impl PartialEq for PartSource
impl PartialEq for PartSource
Source§fn eq(&self, other: &PartSource) -> bool
fn eq(&self, other: &PartSource) -> bool
self and other values to be equal, and is used by ==.