pub struct FilePatchSource { /* private fields */ }Expand description
PatchSource backed by one or more owned std::fs::Files, one per
patch in the chain.
Single-threaded — no internal Mutex. Callers that need concurrent reads
should construct one source per thread.
Implementations§
Source§impl FilePatchSource
impl FilePatchSource
Sourcepub fn open(path: impl AsRef<Path>) -> Result<Self>
pub fn open(path: impl AsRef<Path>) -> Result<Self>
Open a single patch file and wrap it as a one-patch chain.
Equivalent to FilePatchSource::open_chain with a one-element iterator.
§Errors
Returns ZiPatchError::Io if the file cannot be opened.
Sourcepub fn open_chain<I, P>(paths: I) -> Result<Self>
pub fn open_chain<I, P>(paths: I) -> Result<Self>
Open every patch file in paths and wrap them as a chain. The first
path becomes patch index 0, the second index 1, and so on, matching
the order crate::index::PlanBuilder::add_patch consumed them.
§Errors
Returns ZiPatchError::Io on the first path that fails to open.
Sourcepub fn patch_count(&self) -> usize
pub fn patch_count(&self) -> usize
Number of patch files in the chain.
Trait Implementations§
Source§impl Debug for FilePatchSource
impl Debug for FilePatchSource
Auto Trait Implementations§
impl Freeze for FilePatchSource
impl RefUnwindSafe for FilePatchSource
impl Send for FilePatchSource
impl Sync for FilePatchSource
impl Unpin for FilePatchSource
impl UnsafeUnpin for FilePatchSource
impl UnwindSafe for FilePatchSource
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