pub struct RenderCache { /* private fields */ }Expand description
In-memory render cache.
Implementations§
Source§impl RenderCache
impl RenderCache
Sourcepub fn render<B: Backend>(
&mut self,
backend: &B,
input: &ResourceInput<'_>,
) -> Vec<GeneratedArtifact>
pub fn render<B: Backend>( &mut self, backend: &B, input: &ResourceInput<'_>, ) -> Vec<GeneratedArtifact>
Render via cache: lookup by (backend, resource) content hash; on miss, call the backend through the Morphism interface so artifact provenance is populated, then store.
Sourcepub fn stats(&self) -> &CacheStats
pub fn stats(&self) -> &CacheStats
Current cache statistics.
Sourcepub fn invalidate<B: Backend>(
&mut self,
backend: &B,
input: &ResourceInput<'_>,
) -> bool
pub fn invalidate<B: Backend>( &mut self, backend: &B, input: &ResourceInput<'_>, ) -> bool
Remove a specific entry. Returns whether it was present.
Trait Implementations§
Source§impl Debug for RenderCache
impl Debug for RenderCache
Auto Trait Implementations§
impl Freeze for RenderCache
impl RefUnwindSafe for RenderCache
impl Send for RenderCache
impl Sync for RenderCache
impl Unpin for RenderCache
impl UnsafeUnpin for RenderCache
impl UnwindSafe for RenderCache
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