pub struct FileCache { /* private fields */ }Expand description
File-backed key/value store. One file per cached record.
Implementations§
Source§impl FileCache
impl FileCache
Sourcepub fn open(dir: PathBuf) -> Option<Self>
pub fn open(dir: PathBuf) -> Option<Self>
Open or create the cache at dir. Returns None (cache disabled)
if the directory could not be created.
Sourcepub fn key(source: &[u8], path: &Path, cfg_fingerprint: &[u8]) -> String
pub fn key(source: &[u8], path: &Path, cfg_fingerprint: &[u8]) -> String
Compute a hex key for a cache entry. Inputs:
- dmc version (changes invalidate every entry)
- file source bytes
- file path (so two identical-content files at different paths don’t collide)
- opaque config fingerprint (caller-controlled)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FileCache
impl RefUnwindSafe for FileCache
impl Send for FileCache
impl Sync for FileCache
impl Unpin for FileCache
impl UnsafeUnpin for FileCache
impl UnwindSafe for FileCache
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,
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