pub struct ApplySession { /* private fields */ }Expand description
Active apply-time runtime state.
Holds the mutable scratch and bookkeeping a running apply needs: open file-handle cache, memoised directory and path caches, the reusable DEFLATE decompressor, and per-chunk progress counters.
Implementations§
Source§impl ApplySession
impl ApplySession
Sourcepub fn apply_patch<R: Read>(
&mut self,
reader: ZiPatchReader<R>,
) -> ApplyResult<()>
pub fn apply_patch<R: Read>( &mut self, reader: ZiPatchReader<R>, ) -> ApplyResult<()>
Iterate every chunk in reader and apply each one to this session.
This is the primary high-level entry point for applying a patch. It
drives the ZiPatchReader to completion, dispatching each
yielded Chunk through the apply layer in stream order.
Chunks must be applied in order — the ZiPatch format is a
sequential log and later chunks may depend on filesystem state produced
by earlier ones.
§Errors
Stops at the first parse or apply error and returns it immediately. Any filesystem changes already applied by earlier chunks are not rolled back.
Sourcepub fn resume_apply_patch<R: Read + Seek>(
&mut self,
reader: ZiPatchReader<R>,
from: Option<&SequentialCheckpoint>,
) -> ApplyResult<SequentialCheckpoint>
pub fn resume_apply_patch<R: Read + Seek>( &mut self, reader: ZiPatchReader<R>, from: Option<&SequentialCheckpoint>, ) -> ApplyResult<SequentialCheckpoint>
Resume a previously interrupted apply from a SequentialCheckpoint.
See ApplyConfig::resume_apply_patch for the conceptual overview
and the resume contract.
§Errors
Same vocabulary as Self::apply_patch, plus
ApplyError::SchemaVersionMismatch when from.schema_version does
not equal SequentialCheckpoint::CURRENT_SCHEMA_VERSION.
Source§impl ApplySession
impl ApplySession
Sourcepub fn config(&self) -> &ApplyConfig
pub fn config(&self) -> &ApplyConfig
Returns the underlying ApplyConfig.
Sourcepub fn ignore_missing(&self) -> bool
pub fn ignore_missing(&self) -> bool
Returns whether missing files are silently ignored.
Sourcepub fn ignore_old_mismatch(&self) -> bool
pub fn ignore_old_mismatch(&self) -> bool
Returns whether old-data mismatches are silently ignored.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ApplySession
impl !RefUnwindSafe for ApplySession
impl Send for ApplySession
impl !Sync for ApplySession
impl Unpin for ApplySession
impl UnsafeUnpin for ApplySession
impl !UnwindSafe for ApplySession
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