#[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 ==.impl Eq for InFlightAddFile
impl StructuralPartialEq for InFlightAddFile
Auto Trait Implementations§
impl Freeze for InFlightAddFile
impl RefUnwindSafe for InFlightAddFile
impl Send for InFlightAddFile
impl Sync for InFlightAddFile
impl Unpin for InFlightAddFile
impl UnsafeUnpin for InFlightAddFile
impl UnwindSafe for InFlightAddFile
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