pub struct PlanBuilder { /* private fields */ }Expand description
Accumulating builder for a multi-patch Plan.
Construct via PlanBuilder::new, feed each patch in chain order via
PlanBuilder::add_patch, then consume with PlanBuilder::finish.
For a one-shot single-patch build, the three-line dance
PlanBuilder::new().add_patch(name, reader)?.finish() (the add_patch
call returning &mut Self is not supported — use a let mut) is the
canonical form; there is no freestanding convenience wrapper.
Implementations§
Source§impl PlanBuilder
impl PlanBuilder
Sourcepub fn add_patch<R: Read>(
&mut self,
name: impl Into<String>,
reader: ZiPatchReader<R>,
) -> Result<()>
pub fn add_patch<R: Read>( &mut self, name: impl Into<String>, reader: ZiPatchReader<R>, ) -> Result<()>
Read reader to completion, appending the patch to the chain.
Mid-chain destructive ops (RemoveAll, DeleteFile,
AddFile@file_offset=0) retroactively prune accumulated regions from
earlier patches at this point.
§Errors
IndexError::DuplicatePatchifnamematches a patch already added to this builder. The chain protocol is order-sensitive; adding the same patch twice is almost always a caller bug.- Any parser error surfaced by
reader.next_chunk().
§Panics
Panics if the chain grows past u32::MAX patches.
Trait Implementations§
Source§impl Debug for PlanBuilder
impl Debug for PlanBuilder
Auto Trait Implementations§
impl Freeze for PlanBuilder
impl RefUnwindSafe for PlanBuilder
impl Send for PlanBuilder
impl Sync for PlanBuilder
impl Unpin for PlanBuilder
impl UnsafeUnpin for PlanBuilder
impl UnwindSafe for PlanBuilder
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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