pub struct CompilationCache { /* private fields */ }Expand description
Cache for compiled graphs.
Stores compiled graphs by their cache key to avoid recompilation of the same graph with the same configuration.
Implementations§
Source§impl CompilationCache
impl CompilationCache
Sourcepub fn new(max_size: usize) -> Self
pub fn new(max_size: usize) -> Self
Create a new compilation cache with the given maximum size.
Sourcepub fn with_default_size() -> Self
pub fn with_default_size() -> Self
Create a cache with default size (100 entries).
Sourcepub fn get(&self, key: &CompilationKey) -> Option<Arc<CompiledGraph>>
pub fn get(&self, key: &CompilationKey) -> Option<Arc<CompiledGraph>>
Get a compiled graph from the cache.
Sourcepub fn insert(&self, key: CompilationKey, compiled: CompiledGraph)
pub fn insert(&self, key: CompilationKey, compiled: CompiledGraph)
Insert a compiled graph into the cache.
Sourcepub fn stats(&self) -> CacheStats
pub fn stats(&self) -> CacheStats
Get cache statistics.
Auto Trait Implementations§
impl Freeze for CompilationCache
impl RefUnwindSafe for CompilationCache
impl Send for CompilationCache
impl Sync for CompilationCache
impl Unpin for CompilationCache
impl UnwindSafe for CompilationCache
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