[−][src]Struct librsync::Signature
A struct to generate a signature.
This type takes a Read
stream for the input from which compute the signatures, and implements
another Read
stream from which get the result.
Methods
impl<R: Read> Signature<BufReader<R>>
[src]
pub fn new(input: R) -> Result<Self>
[src]
Creates a new signature stream with default parameters.
This constructor takes an input stream for the file from which compute the signatures. Default options are used for the signature format: BLAKE2 for the hashing, 2048 bytes for the block length and full length for the strong signature size.
pub fn with_options(
input: R,
block_len: usize,
strong_len: usize,
sig_magic: SignatureType
) -> Result<Self>
[src]
input: R,
block_len: usize,
strong_len: usize,
sig_magic: SignatureType
) -> Result<Self>
Creates a new signature stream by specifying custom parameters.
This constructor takes the input stream for the file from which compute the signatures, the
size of checksum blocks as block_len
parameter (larger values make the signature shorter
and the delta longer), and the size of strong signatures in bytes as strong_len
parameter. If it is non-zero the signature will be truncated to that amount of bytes.
The last parameter specifies which version of the signature format to be used.
impl<R: BufRead> Signature<R>
[src]
pub fn with_buf_read(
input: R,
block_len: usize,
strong_len: usize,
sig_magic: SignatureType
) -> Result<Self>
[src]
input: R,
block_len: usize,
strong_len: usize,
sig_magic: SignatureType
) -> Result<Self>
Creates a new signature stream by using a BufRead
.
This constructor takes an already built BufRead
instance. Prefer this constructor if
you already have a BufRead
as input stream, since it avoids wrapping the input stream
into another BufRead
instance. See with_options
constructor for details on the other
parameters.
pub fn into_inner(self) -> R
[src]
Unwraps this stream, returning the underlying input stream.
Trait Implementations
impl<R: BufRead> Read for Signature<R>
[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]
Auto Trait Implementations
impl<R> RefUnwindSafe for Signature<R> where
R: RefUnwindSafe,
R: RefUnwindSafe,
impl<R> Send for Signature<R> where
R: Send,
R: Send,
impl<R> !Sync for Signature<R>
impl<R> Unpin for Signature<R> where
R: Unpin,
R: Unpin,
impl<R> UnwindSafe for Signature<R> where
R: UnwindSafe,
R: UnwindSafe,
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>,