pub struct Fingerprint {
pub bytes: u64,
pub hash: u64,
}Expand description
A fingerprint of file content. Used with FsBackend::fingerprint and
Fingerprint::of:
edit_file records the fingerprint after reading, and takes it again before writing;
a mismatch indicates a concurrent write conflict.
Uses (bytes, hash) instead of a plain hash: comparing both length and hash reduces
the collision probability of a single u64 hash to negligible. DefaultHasher is
only used for in-process one-shot comparisons, never persisted or shared across
processes, so the standard library’s “unspecified but stable” semantics are
acceptable.
Fields§
§bytes: u64§hash: u64Implementations§
Trait Implementations§
Source§impl Clone for Fingerprint
impl Clone for Fingerprint
Source§fn clone(&self) -> Fingerprint
fn clone(&self) -> Fingerprint
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for Fingerprint
Source§impl Debug for Fingerprint
impl Debug for Fingerprint
impl Eq for Fingerprint
Source§impl PartialEq for Fingerprint
impl PartialEq for Fingerprint
Source§fn eq(&self, other: &Fingerprint) -> bool
fn eq(&self, other: &Fingerprint) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for Fingerprint
Auto Trait Implementations§
impl Freeze for Fingerprint
impl RefUnwindSafe for Fingerprint
impl Send for Fingerprint
impl Sync for Fingerprint
impl Unpin for Fingerprint
impl UnsafeUnpin for Fingerprint
impl UnwindSafe for Fingerprint
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