pub struct Fingerprint {
pub exact: Digest,
pub canonical: Digest,
}Expand description
Exact and canonical digests of one file; see Fingerprint::of.
Fields§
§exact: DigestDigest of the bytes as they are.
canonical: DigestDigest of the canonical form.
Implementations§
Source§impl Fingerprint
impl Fingerprint
Sourcepub fn of(bytes: &[u8]) -> Self
pub fn of(bytes: &[u8]) -> Self
Fingerprints bytes, reading them once.
The canonical form drops a UTF-8 BOM, strips trailing whitespace from every line, drops
trailing blank lines and ends in exactly one \n. Binary content, git’s test of a NUL in
the first 8000 bytes, is its own canonical form.
Sourcepub fn same_content(&self, other: &Self) -> bool
pub fn same_content(&self, other: &Self) -> bool
Whether self and other differ at most cosmetically.
Trait Implementations§
Source§impl Clone for Fingerprint
impl Clone for Fingerprint
impl Copy for Fingerprint
Source§impl Debug for Fingerprint
impl Debug for Fingerprint
Source§impl<'de> Deserialize<'de> for Fingerprint
impl<'de> Deserialize<'de> for Fingerprint
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Fingerprint
Source§impl PartialEq for Fingerprint
impl PartialEq for Fingerprint
Source§impl Serialize for Fingerprint
impl Serialize for Fingerprint
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.