pub struct Cache { /* private fields */ }Expand description
What the text of a file was made into, kept by the file’s path (see the module).
Implementations§
Source§impl Cache
impl Cache
Sourcepub fn stored(store: Box<dyn CacheStore>) -> Self
pub fn stored(store: Box<dyn CacheStore>) -> Self
A cache kept in memory, and between processes in store.
Sourcepub fn made_of<T: Serialize + DeserializeOwned + 'static>(
&self,
kind: &'static str,
path: &str,
text: &Rc<str>,
make: impl FnOnce(&str) -> GeopResult<T>,
) -> GeopResult<Rc<T>>
pub fn made_of<T: Serialize + DeserializeOwned + 'static>( &self, kind: &'static str, path: &str, text: &Rc<str>, make: impl FnOnce(&str) -> GeopResult<T>, ) -> GeopResult<Rc<T>>
What the text text of the file path reads as, as kind: made by
make once, for this text of this file, and kept. A value that
could not be made is not kept: it is made again when asked again.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Cache
impl !RefUnwindSafe for Cache
impl !Send for Cache
impl !Sync for Cache
impl !UnwindSafe for Cache
impl Unpin for Cache
impl UnsafeUnpin for Cache
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