#[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 ==.impl Eq for PartSource
impl StructuralPartialEq for PartSource
Auto Trait Implementations§
impl Freeze for PartSource
impl RefUnwindSafe for PartSource
impl Send for PartSource
impl Sync for PartSource
impl Unpin for PartSource
impl UnsafeUnpin for PartSource
impl UnwindSafe for PartSource
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more