pub struct HashCache { /* private fields */ }Expand description
A size+mtime keyed cache of working-file content hashes.
Implementations§
Source§impl HashCache
impl HashCache
Sourcepub fn load(repo: &Repository) -> HashCache
pub fn load(repo: &Repository) -> HashCache
Load the cache, tolerating a missing or legacy/placeholder file (returns an empty cache rather than failing).
Sourcepub fn save(&self, repo: &Repository) -> Result<()>
pub fn save(&self, repo: &Repository) -> Result<()>
Persist the cache to .cadvm/index.json.
Sourcepub fn hash(&mut self, repo: &Repository, rel: &Path) -> Result<ObjectId>
pub fn hash(&mut self, repo: &Repository, rel: &Path) -> Result<ObjectId>
Content hash of a working file, reusing the cache when size+mtime match and otherwise stream-hashing the file and updating the cache.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for HashCache
impl<'de> Deserialize<'de> for HashCache
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
Auto Trait Implementations§
impl Freeze for HashCache
impl RefUnwindSafe for HashCache
impl Send for HashCache
impl Sync for HashCache
impl Unpin for HashCache
impl UnsafeUnpin for HashCache
impl UnwindSafe for HashCache
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