pub struct FsCache<StoredData>{ /* private fields */ }Implementations§
Source§impl<StoredData> FsCache<StoredData>
impl<StoredData> FsCache<StoredData>
pub fn new(path: &Path, fingerprint: &str) -> Result<Self>
Sourcepub fn load(&self, f: impl Fn() -> StoredData) -> Result<StoredData>
pub fn load(&self, f: impl Fn() -> StoredData) -> Result<StoredData>
Create or open a fingerprinted cache at path.
If the existing on-disk fingerprint differs from fingerprint, the
data is generated by f and written to disk and the fingerprint
file is updated. Otherwise the existing data is reused.
Auto Trait Implementations§
impl<StoredData> Freeze for FsCache<StoredData>
impl<StoredData> RefUnwindSafe for FsCache<StoredData>where
StoredData: RefUnwindSafe,
impl<StoredData> Send for FsCache<StoredData>where
StoredData: Send,
impl<StoredData> Sync for FsCache<StoredData>where
StoredData: Sync,
impl<StoredData> Unpin for FsCache<StoredData>where
StoredData: Unpin,
impl<StoredData> UnsafeUnpin for FsCache<StoredData>
impl<StoredData> UnwindSafe for FsCache<StoredData>where
StoredData: UnwindSafe,
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