#[non_exhaustive]pub struct ChunkRecord {
pub chunk: Chunk,
pub tag: ChunkTag,
pub body_offset: u64,
pub bytes_read: u64,
}Expand description
One chunk yielded by ZiPatchReader::next_chunk together with the
stream-position metadata the parser observed while reading it.
Bundling the chunk with its byte-position metadata in one record lets
downstream consumers (the apply driver, the crate::index::PlanBuilder,
the zipatch dump CLI) avoid a second round of accessor calls against
the reader to learn where the chunk sat in the stream. Each field
describes one fact the parser knew at the moment the chunk was yielded;
see the per-field docs.
#[non_exhaustive]: stream-position metadata may grow (e.g. compressed
payload size, header-only byte count) as new index-builder needs surface.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.chunk: ChunkThe parsed chunk itself.
tag: ChunkTagThe 4-byte ASCII wire tag of the chunk (FHDR, SQPK, EOF_, …).
Exposed alongside Self::chunk so consumers can attach the tag
to a progress event without re-matching on the Chunk enum.
body_offset: u64Absolute patch-file offset of the chunk’s body — the byte right
after the 8-byte [body_len: u32 BE, tag: [u8; 4]] frame header.
Index builders use this to compute absolute patch-file offsets for
SqpkAddData::data, SqpkFile block payloads, and
SqpkHeader::header_data without re-walking the stream.
bytes_read: u64Running total of bytes consumed from the patch stream, including the 12-byte magic header, the chunk this record describes, and every preceding chunk frame.
Equivalent to the crate::ChunkEvent::bytes_read field at the
same emission point; used for the bytes_applied / total_patch_size
progress-bar ratio.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ChunkRecord
impl RefUnwindSafe for ChunkRecord
impl Send for ChunkRecord
impl Sync for ChunkRecord
impl Unpin for ChunkRecord
impl UnsafeUnpin for ChunkRecord
impl UnwindSafe for ChunkRecord
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> 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