pub struct OutputCache { /* private fields */ }Expand description
Cache for cell outputs.
Implementations§
Source§impl OutputCache
impl OutputCache
Sourcepub fn new(cache_dir: impl AsRef<Path>) -> SyncResult<Self>
pub fn new(cache_dir: impl AsRef<Path>) -> SyncResult<Self>
Create a new output cache.
Sourcepub fn get_output(&self, cell_name: &str) -> Option<CellOutput>
pub fn get_output(&self, cell_name: &str) -> Option<CellOutput>
Get cached output for a cell.
Sourcepub fn store_text(&mut self, cell_name: &str, text: &str)
pub fn store_text(&mut self, cell_name: &str, text: &str)
Store text output for a cell.
Sourcepub fn store_html(&mut self, cell_name: &str, html: &str)
pub fn store_html(&mut self, cell_name: &str, html: &str)
Store HTML output for a cell.
Sourcepub fn store_png(&mut self, cell_name: &str, png_data: &[u8])
pub fn store_png(&mut self, cell_name: &str, png_data: &[u8])
Store PNG image output for a cell.
Sourcepub fn store_json(&mut self, cell_name: &str, json: Value)
pub fn store_json(&mut self, cell_name: &str, json: Value)
Store JSON output for a cell.
Sourcepub fn store_error(&mut self, cell_name: &str, error: &str)
pub fn store_error(&mut self, cell_name: &str, error: &str)
Store error output for a cell.
Sourcepub fn save_to_disk(&self) -> SyncResult<()>
pub fn save_to_disk(&self) -> SyncResult<()>
Save cache to disk.
Auto Trait Implementations§
impl Freeze for OutputCache
impl RefUnwindSafe for OutputCache
impl Send for OutputCache
impl Sync for OutputCache
impl Unpin for OutputCache
impl UnwindSafe for OutputCache
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