pub struct CacheDigest {
pub algorithm: String,
pub hash: String,
pub size: u64,
}Fields§
§algorithm: String§hash: String§size: u64Implementations§
Source§impl CacheDigest
impl CacheDigest
pub fn blake3(bytes: &[u8]) -> Self
Sourcepub fn blake3_file(path: &Path) -> Result<Self>
pub fn blake3_file(path: &Path) -> Result<Self>
Hash a file while counting the bytes read in the same streaming pass.
pub fn validate(&self) -> Result<()>
pub fn matches_bytes(&self, bytes: &[u8]) -> Result<bool>
pub fn matches_file(&self, path: &Path) -> Result<bool>
Trait Implementations§
Source§impl Clone for CacheDigest
impl Clone for CacheDigest
Source§fn clone(&self) -> CacheDigest
fn clone(&self) -> CacheDigest
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 moreSource§impl Debug for CacheDigest
impl Debug for CacheDigest
Source§impl<'de> Deserialize<'de> for CacheDigest
impl<'de> Deserialize<'de> for CacheDigest
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 CacheDigest
Source§impl Ord for CacheDigest
impl Ord for CacheDigest
Source§fn cmp(&self, other: &CacheDigest) -> Ordering
fn cmp(&self, other: &CacheDigest) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for CacheDigest
impl PartialEq for CacheDigest
Source§impl PartialOrd for CacheDigest
impl PartialOrd for CacheDigest
Source§impl Serialize for CacheDigest
impl Serialize for CacheDigest
impl StructuralPartialEq for CacheDigest
Auto Trait Implementations§
impl Freeze for CacheDigest
impl RefUnwindSafe for CacheDigest
impl Send for CacheDigest
impl Sync for CacheDigest
impl Unpin for CacheDigest
impl UnsafeUnpin for CacheDigest
impl UnwindSafe for CacheDigest
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