pub struct DedupCache(/* private fields */);Expand description
In-memory cache of FileWithChunks indexed by their relative paths.
Implementations§
Source§impl DedupCache
impl DedupCache
Sourcepub fn get_chunks(
&self,
) -> Result<impl Iterator<Item = (String, FileChunk, bool)> + '_, Error>
pub fn get_chunks( &self, ) -> Result<impl Iterator<Item = (String, FileChunk, bool)> + '_, Error>
Iterates over all chunks, yielding the chunk hash, enriched FileChunk with path, and a
flag indicating if it was freshly calculated.
pub fn get(&self, path: &str) -> Option<&FileWithChunks>
pub fn get_mut(&mut self, path: &str) -> Option<&mut FileWithChunks>
pub fn contains_key(&self, path: &str) -> bool
pub fn into_iter(self) -> IntoIter<String, FileWithChunks>
pub fn values(&self) -> impl Iterator<Item = &FileWithChunks>
pub fn len(&self) -> usize
Auto Trait Implementations§
impl Freeze for DedupCache
impl !RefUnwindSafe for DedupCache
impl Send for DedupCache
impl !Sync for DedupCache
impl Unpin for DedupCache
impl UnwindSafe for DedupCache
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more