pub struct Signature { /* private fields */ }
Expand description
An rsync signature.
A signature contains hashed information about a block of data. It is used to compute a delta against that data.
Implementations§
Source§impl Signature
impl Signature
Sourcepub fn calculate(buf: &[u8], options: SignatureOptions) -> Signature
pub fn calculate(buf: &[u8], options: SignatureOptions) -> Signature
Compute an MD4 signature for the given data.
options.block_size
must be greater than zero. options.crypto_hash_size
must be at most 16, the length of an MD4 hash.
Panics if the provided options are invalid.
Sourcepub fn deserialize(signature: Vec<u8>) -> Result<Signature, SignatureParseError>
pub fn deserialize(signature: Vec<u8>) -> Result<Signature, SignatureParseError>
Read a binary signature.
Sourcepub fn serialized(&self) -> &[u8] ⓘ
pub fn serialized(&self) -> &[u8] ⓘ
Get the serialized form of this signature.
Sourcepub fn into_serialized(self) -> Vec<u8> ⓘ
pub fn into_serialized(self) -> Vec<u8> ⓘ
Get ownership of the serialized form of this signature.
Sourcepub fn index(&self) -> IndexedSignature<'_>
pub fn index(&self) -> IndexedSignature<'_>
Convert a signature to a form suitable for computing deltas.
Trait Implementations§
impl Eq for Signature
impl StructuralPartialEq for Signature
Auto Trait Implementations§
impl Freeze for Signature
impl RefUnwindSafe for Signature
impl Send for Signature
impl Sync for Signature
impl Unpin for Signature
impl UnwindSafe for Signature
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