[][src]Struct librsync::Signature

pub struct Signature<R> { /* fields omitted */ }

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]

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]

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]

Auto Trait Implementations

impl<R> RefUnwindSafe for Signature<R> where
    R: RefUnwindSafe

impl<R> Send for Signature<R> where
    R: Send

impl<R> !Sync for Signature<R>

impl<R> Unpin for Signature<R> where
    R: Unpin

impl<R> UnwindSafe for Signature<R> where
    R: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.