Skip to main content

CacheStore

Trait CacheStore 

Source
pub trait CacheStore {
    // Required methods
    fn build(&self) -> &str;
    fn read(&self, path: &str) -> Option<String>;
    fn write(&self, path: &str, text: &str);
}
Expand description

Where a Cache keeps what it made between processes: a folder on disk, for a kernel run by the command line or an editor’s host process.

Required Methods§

Source

fn build(&self) -> &str

What tells this build of the kernel from every other: what it made is only read back by the same build.

Source

fn read(&self, path: &str) -> Option<String>

The text of the cache file path, if there is one.

Source

fn write(&self, path: &str, text: &str)

Writes the cache file path. A cache that could not be written is made again next time, nothing else, so a failure is the store’s to report, if anywhere.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§