pub struct Delta<R> { /* private fields */ }
Expand description
A struct to generate a delta between two files.
This type takes two Read
streams, one for the signature of the base file and one for the new
file. It then provides another Read
stream from which get the result.
Implementations§
source§impl<R: Read> Delta<BufReader<R>>
impl<R: Read> Delta<BufReader<R>>
sourcepub fn new<S: Read + ?Sized>(new: R, base_sig: &mut S) -> Result<Self>
pub fn new<S: Read + ?Sized>(new: R, base_sig: &mut S) -> Result<Self>
Creates a new delta stream.
This constructor takes two Read
streams for the new file (new
parameter) and for the
signatures of the base file (base_sig
parameter). It produces a delta stream from which
read the resulting delta file.
source§impl<R: BufRead> Delta<R>
impl<R: BufRead> Delta<R>
sourcepub fn with_buf_read<S: Read + ?Sized>(new: R, base_sig: &mut S) -> Result<Self>
pub fn with_buf_read<S: Read + ?Sized>(new: R, base_sig: &mut S) -> Result<Self>
Creates a new delta stream by using a BufRead
as new file.
This constructor specializes the new
constructor by taking a BufRead
instance as
new
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.
sourcepub fn into_inner(self) -> R
pub fn into_inner(self) -> R
Unwraps this stream, returning the underlying new file stream.
Trait Implementations§
source§impl<R: BufRead> Read for Delta<R>
impl<R: BufRead> Read for Delta<R>
source§fn read(&mut self, buf: &mut [u8]) -> Result<usize>
fn read(&mut self, buf: &mut [u8]) -> Result<usize>
1.36.0 · source§fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> Result<usize, Error>
fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> Result<usize, Error>
read
, except that it reads into a slice of buffers. Read moresource§fn is_read_vectored(&self) -> bool
fn is_read_vectored(&self) -> bool
can_vector
)1.0.0 · source§fn read_to_end(&mut self, buf: &mut Vec<u8, Global>) -> Result<usize, Error>
fn read_to_end(&mut self, buf: &mut Vec<u8, Global>) -> Result<usize, Error>
buf
. Read more1.0.0 · source§fn read_to_string(&mut self, buf: &mut String) -> Result<usize, Error>
fn read_to_string(&mut self, buf: &mut String) -> Result<usize, Error>
buf
. Read more1.6.0 · source§fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), Error>
fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), Error>
buf
. Read moresource§fn read_buf(&mut self, buf: BorrowedCursor<'_>) -> Result<(), Error>
fn read_buf(&mut self, buf: BorrowedCursor<'_>) -> Result<(), Error>
read_buf
)source§fn read_buf_exact(&mut self, cursor: BorrowedCursor<'_>) -> Result<(), Error>
fn read_buf_exact(&mut self, cursor: BorrowedCursor<'_>) -> Result<(), Error>
read_buf
)cursor
. Read more1.0.0 · source§fn by_ref(&mut self) -> &mut Selfwhere
Self: Sized,
fn by_ref(&mut self) -> &mut Selfwhere Self: Sized,
Read
. Read more