#[non_exhaustive]pub struct InFlightAddFile {
pub target_path: PathBuf,
pub file_offset: u64,
pub block_idx: u32,
pub bytes_into_target: u64,
}Expand description
Mid-AddFile state — the DEFLATE block boundary the driver is between.
Resume reads this back, opens target_path, seeks to
file_offset + bytes_into_target, and re-feeds the chunk’s remaining
blocks starting from block_idx. The chunk’s path and file_offset
are echoed in full to make the resume self-contained — callers shouldn’t
have to cross-reference the original patch stream to interpret the
checkpoint.
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.target_path: PathBufAbsolute filesystem path of the target file the AddFile writes into.
file_offset: u64The chunk’s wire-format file_offset — the byte offset within the
target file at which block 0 starts.
block_idx: u32Zero-based index of the next block to write. Equal to the count
of blocks already written for this AddFile.
bytes_into_target: u64Total decompressed bytes written into the target file so far for
this AddFile. The current writer position is
file_offset + bytes_into_target.
Implementations§
Source§impl InFlightAddFile
impl InFlightAddFile
Sourcepub fn new(
target_path: PathBuf,
file_offset: u64,
block_idx: u32,
bytes_into_target: u64,
) -> Self
pub fn new( target_path: PathBuf, file_offset: u64, block_idx: u32, bytes_into_target: u64, ) -> Self
Construct an InFlightAddFile with the given fields.
Exists because the struct is #[non_exhaustive], which forbids
external code from using the struct-literal syntax.
§Notes
Permissive by design: any combination of fields is accepted,
including ones the apply driver would never produce (e.g.
block_idx = u32::MAX, or a bytes_into_target that does not
correspond to any real block boundary). Resume re-validates the
in-flight state against the patch stream and the on-disk file
before acting on it; contradictory inputs trigger a warn-and-restart
path rather than silent corruption.
Trait Implementations§
Source§impl Clone for InFlightAddFile
impl Clone for InFlightAddFile
Source§fn clone(&self) -> InFlightAddFile
fn clone(&self) -> InFlightAddFile
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 InFlightAddFile
impl Debug for InFlightAddFile
Source§impl PartialEq for InFlightAddFile
impl PartialEq for InFlightAddFile
Source§fn eq(&self, other: &InFlightAddFile) -> bool
fn eq(&self, other: &InFlightAddFile) -> bool
self and other values to be equal, and is used by ==.