[−][src]Struct librsync::Patch
A struct to apply a delta to a basis file, to recreate the new file.
This type takes a Read + Seek
stream for the base file, and a Read
stream for the delta
file. It then provides another Read
stream from which get the resulting patched file.
Methods
impl<'a, B: Read + Seek + 'a, D: Read> Patch<'a, B, BufReader<D>>
[src]
pub fn new(base: B, delta: D) -> Result<Self>
[src]
Creates a new patch stream.
This constructor takes a Read + Seek
stream for the basis file (base
parameter), and a
Read
stream for the delta file (delta
parameter). It produces a stream from which read
the resulting patched file.
impl<'a, B: Read + Seek + 'a, D: BufRead> Patch<'a, B, D>
[src]
pub fn with_buf_read(base: B, delta: D) -> Result<Self>
[src]
Creates a new patch stream by using a BufRead
as delta stream.
This constructor specializes the new
constructor by taking a BufRead
instance as
delta
parameter. Prefer this constructor if you already have a BufRead
as input
stream, since it avoids wrapping the input stream into another BufRead
instance. See
new
constructor for more details on the parameters.
pub fn into_inner(self) -> (B, D)
[src]
Unwraps this stream and returns the underlying streams.
Trait Implementations
impl<'a, B, D: BufRead> Read for Patch<'a, B, D>
[src]
fn read(&mut self, buf: &mut [u8]) -> Result<usize>
[src]
fn read_vectored(&mut self, bufs: &mut [IoSliceMut]) -> Result<usize, Error>
1.36.0[src]
unsafe fn initializer(&self) -> Initializer
[src]
fn read_to_end(&mut self, buf: &mut Vec<u8>) -> Result<usize, Error>
1.0.0[src]
fn read_to_string(&mut self, buf: &mut String) -> Result<usize, Error>
1.0.0[src]
fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), Error>
1.6.0[src]
fn by_ref(&mut self) -> &mut Self
1.0.0[src]
fn bytes(self) -> Bytes<Self>
1.0.0[src]
fn chain<R>(self, next: R) -> Chain<Self, R> where
R: Read,
1.0.0[src]
R: Read,
fn take(self, limit: u64) -> Take<Self>
1.0.0[src]
impl<'a, B: 'a, D> Send for Patch<'a, B, D> where
B: Send,
D: Send,
[src]
B: Send,
D: Send,
Auto Trait Implementations
impl<'a, B, D> !RefUnwindSafe for Patch<'a, B, D>
impl<'a, B, D> !Sync for Patch<'a, B, D>
impl<'a, B, D> Unpin for Patch<'a, B, D> where
D: Unpin,
D: Unpin,
impl<'a, B, D> !UnwindSafe for Patch<'a, B, D>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,